aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/filesystem.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-03-18 19:33:28 +0100
committerDan Engelbrecht <[email protected]>2025-03-18 19:33:28 +0100
commit9debdcada68980e73b3d76681be3cef0cc937edd (patch)
treec9bc6d0ca3cd3c3c5d0b943e00e2312e742c90a6 /src/zencore/filesystem.cpp
parentMerge remote-tracking branch 'origin/main' into sb/build-cache (diff)
parentimproved reporting on async error (#312) (diff)
downloadzen-sb/build-cache.tar.xz
zen-sb/build-cache.zip
Merge remote-tracking branch 'origin/main' into sb/build-cachesb/build-cache
Diffstat (limited to 'src/zencore/filesystem.cpp')
-rw-r--r--src/zencore/filesystem.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp
index 9f3f4f7fc..05e2bf049 100644
--- a/src/zencore/filesystem.cpp
+++ b/src/zencore/filesystem.cpp
@@ -2043,6 +2043,19 @@ SetFileReadOnly(const std::filesystem::path& Filename, bool ReadOnly)
return false;
}
+std::filesystem::path
+StringToPath(const std::string_view& Path)
+{
+ if (Path.length() > 2 && Path.front() == '\"' && Path.back() == '\"')
+ {
+ return std::filesystem::path(Path.substr(1, Path.length() - 2)).make_preferred();
+ }
+ else
+ {
+ return std::filesystem::path(Path).make_preferred();
+ }
+}
+
//////////////////////////////////////////////////////////////////////////
//
// Testing related code follows...