summaryrefslogtreecommitdiffstats
path: root/source/core/slang-io.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-10-26 08:16:54 -0400
committerGitHub <noreply@github.com>2018-10-26 08:16:54 -0400
commitcb9d679a3a93c65c44904bf77811b9d74e431e23 (patch)
treebdc78bc01351f6eeed4714d01cd3aef6cf067109 /source/core/slang-io.h
parentad47fe71defcc96a7bed87a4c3a40543978f0fb8 (diff)
Feature/file system cache (#692)
* First pass at caching file system. * default-file-system -> slang-file-system fix problem with location("build.linux") confusing windows build for now. * Added CompressedResult Fix problem in Result construction with it being unsigned * Add support for Path simplification. * Testing for Path::Simplify. * Refactored CacheFileSystem - automatically handles ISlangFileSystem or ISlangFileSystemExt appropriately. Removed WrapFileSystem - because wasn't possible to emulate some of the behavior if just loadFile is implemented. Split out StringBlob - so that no need to convert between ISlangBlob and String repeatidly. * Remove unwanted code in ~CompileRequest
Diffstat (limited to 'source/core/slang-io.h')
-rw-r--r--source/core/slang-io.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/core/slang-io.h b/source/core/slang-io.h
index ff287254c..3703aee08 100644
--- a/source/core/slang-io.h
+++ b/source/core/slang-io.h
@@ -32,6 +32,17 @@ namespace Slang
static String Combine(const String & path1, const String & path2, const String & path3);
static bool CreateDir(const String & path);
+ /// Accept either style of delimiter
+ SLANG_FORCE_INLINE static bool IsDelimiter(char c) { return c == '/' || c == '\\'; }
+
+ static bool IsDriveSpecification(const UnownedStringSlice& element);
+
+ /// Splits the path into it's individual bits
+ static void Split(const UnownedStringSlice& path, List<UnownedStringSlice>& splitOut);
+ /// Strips .. and . as much as it can
+ static String Simplify(const UnownedStringSlice& path);
+ static String Simplify(const String& path) { return Simplify(path.getUnownedSlice()); }
+
static SlangResult GetPathType(const String & path, SlangPathType* pathTypeOut);
static SlangResult GetCanonical(const String & path, String& canonicalPathOut);