summaryrefslogtreecommitdiffstats
path: root/source/core/slang-io.cpp
diff options
context:
space:
mode:
authorskallweitNV <64953474+skallweitNV@users.noreply.github.com>2024-08-07 17:53:33 +0200
committerGitHub <noreply@github.com>2024-08-07 08:53:33 -0700
commit9b580e58417a77109617804362be872f05885f23 (patch)
treea2af2c0da8036913ca0f3f5515bb81e7c88ec57f /source/core/slang-io.cpp
parent2f2ae8c31490ab01ce0d0cc76d5d7fcf1d21efe7 (diff)
Reduce dependency on std library (#4785)
Diffstat (limited to 'source/core/slang-io.cpp')
-rw-r--r--source/core/slang-io.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/core/slang-io.cpp b/source/core/slang-io.cpp
index f5850a5b6..54a8fc79e 100644
--- a/source/core/slang-io.cpp
+++ b/source/core/slang-io.cpp
@@ -562,6 +562,13 @@ namespace Slang
#endif
}
+ bool Path::createDirectoryRecursive(const String& path)
+ {
+ std::error_code ec;
+ std::filesystem::create_directories(path.getBuffer(), ec);
+ return !ec;
+ }
+
/* static */SlangResult Path::getPathType(const String& path, SlangPathType* pathTypeOut)
{
#ifdef _WIN32
@@ -661,6 +668,13 @@ namespace Slang
#endif
}
+ String Path::getCurrentPath()
+ {
+ Slang::String path;
+ getCanonical(".", path);
+ return path;
+ }
+
String Path::getRelativePath(String base, String path)
{
std::filesystem::path p1(base.getBuffer());