From b59451020eee59cd52e4d8231360ebed4fc59adb Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 19 Nov 2020 04:14:48 -0500 Subject: File system refactor (#1611) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP FileSystem refactor. * Made loadFile load the file in binary mode. * Fixed some comments. Fixed typo in RelativePath - not used 'fixedPath'. --- source/slang/slang-options.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/slang/slang-options.cpp') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 6a5b43876..60d41ee5c 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -529,7 +529,7 @@ struct OptionsParser SlangPathType pathType; if (SLANG_SUCCEEDED(Path::getPathType(dirPath, &pathType)) && pathType == SLANG_PATH_TYPE_DIRECTORY) { - fileSystem = new RelativeFileSystem(OSFileSystemExt::getSingleton(), dirPath); + fileSystem = new RelativeFileSystem(OSFileSystem::getExtSingleton(), dirPath); } } @@ -557,7 +557,7 @@ struct OptionsParser SlangPathType pathType; if (SLANG_SUCCEEDED(Path::getPathType(dirPath, &pathType)) && pathType == SLANG_PATH_TYPE_DIRECTORY) { - dirFileSystem = new RelativeFileSystem(OSFileSystemExt::getSingleton(), dirPath, true); + dirFileSystem = new RelativeFileSystem(OSFileSystem::getExtSingleton(), dirPath, true); } } @@ -907,13 +907,13 @@ struct OptionsParser } else if (name == "load-file") { - // OSFileSystem just implements loadFile interface, so will be wrapped with CacheFileSystem internally - spSetFileSystem(compileRequest, OSFileSystem::getSingleton()); + // 'Simple' just implements loadFile interface, so will be wrapped with CacheFileSystem internally + spSetFileSystem(compileRequest, OSFileSystem::getLoadSingleton()); } else if (name == "os") { - // OSFileSystemExt implements the ISlangFileSystemExt interface - and will be used directly - spSetFileSystem(compileRequest, OSFileSystemExt::getSingleton()); + // 'Immutable' implements the ISlangFileSystemExt interface - and will be used directly + spSetFileSystem(compileRequest, OSFileSystem::getExtSingleton()); } else { -- cgit v1.2.3