From 2700a89f8c80620f1d523563cc80ec0da39e9761 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 22 Oct 2018 20:48:59 -0400 Subject: Fix problem with __import not working (#688) * Added getPathType to ISlangFileSystemExt. This is needed so that when searching for a file it's existance can be tested without loading the file. On some platforms a getCanonicalPath can do this - but depending on how getCanonicalPath is implemented, it may not do. This test is made after the relative path is produced before finding the canonical path. * Test for importing along search path. * Added comment to explain the issue around WrapFileSystem impl of getPathType. * Make search path use / not \ --- source/slang/default-file-system.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/slang/default-file-system.h') diff --git a/source/slang/default-file-system.h b/source/slang/default-file-system.h index 62d7cbfc5..47644f5ad 100644 --- a/source/slang/default-file-system.h +++ b/source/slang/default-file-system.h @@ -33,11 +33,15 @@ public: const char* path, ISlangBlob** pathOut) SLANG_OVERRIDE; + virtual SLANG_NO_THROW SlangResult SLANG_MCALL getPathType( + const char* path, + SlangPathType* pathTypeOut) SLANG_OVERRIDE; + /// Get a default instance static ISlangFileSystemExt* getSingleton() { return &s_singleton; } private: - /// Make so not constructable + /// Make so not constructible DefaultFileSystem() {} ISlangUnknown* getInterface(const Guid& guid); @@ -75,6 +79,10 @@ public: const char* path, ISlangBlob** pathOut) SLANG_OVERRIDE; + virtual SLANG_NO_THROW SlangResult SLANG_MCALL getPathType( + const char* path, + SlangPathType* pathTypeOut) SLANG_OVERRIDE; + /// Ctor WrapFileSystem(ISlangFileSystem* fileSystem): m_fileSystem(fileSystem) -- cgit v1.2.3