From 9b580e58417a77109617804362be872f05885f23 Mon Sep 17 00:00:00 2001 From: skallweitNV <64953474+skallweitNV@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:53:33 +0200 Subject: Reduce dependency on std library (#4785) --- source/core/slang-io.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/core/slang-io.cpp') 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()); -- cgit v1.2.3