Skip to content

Commit 58f945d

Browse files
authored
Use std::filesystem to build task paths (#452)
Use `std::filesystem::path` when constructing task file paths
1 parent a23b1ac commit 58f945d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/core/util/src/util.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
namespace {
1010

1111
std::string GetAbsolutePath(const std::string& relative_path) {
12-
const std::filesystem::path path = std::string(PPC_PATH_TO_PROJECT) + "/tasks/" + relative_path;
12+
std::filesystem::path path = std::filesystem::path(PPC_PATH_TO_PROJECT) / "tasks" / relative_path;
1313
return path.string();
1414
}
1515

1616
} // namespace
1717

1818
std::string ppc::util::GetAbsoluteTaskPath(const std::string& id_path, const std::string& relative_path) {
19-
return GetAbsolutePath(id_path + "/data/" + relative_path);
19+
std::filesystem::path task_relative = std::filesystem::path(id_path) / "data" / relative_path;
20+
return GetAbsolutePath(task_relative.string());
2021
}
2122

2223
int ppc::util::GetNumThreads() {

0 commit comments

Comments
 (0)