summaryrefslogtreecommitdiff
path: root/source/core/slang-io.cpp
diff options
context:
space:
mode:
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());