summaryrefslogtreecommitdiffstats
path: root/slang.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-10-22 20:48:59 -0400
committerTim Foley <tfoleyNV@users.noreply.github.com>2018-10-22 17:48:59 -0700
commit2700a89f8c80620f1d523563cc80ec0da39e9761 (patch)
tree375f29ffcc5ad4e0ced42b51f1cc214f7b37374a /slang.h
parentcda9c3b1a712715209a3f4ba155c1425898334cb (diff)
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 \
Diffstat (limited to 'slang.h')
-rw-r--r--slang.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/slang.h b/slang.h
index 4157f306d..d1a3803d1 100644
--- a/slang.h
+++ b/slang.h
@@ -685,7 +685,7 @@ extern "C"
typedef unsigned int SlangPathType;
enum
{
- SLANG_PATH_TYPE_DIRECTORY, /**< Path specified specifies a directory. */
+ SLANG_PATH_TYPE_DIRECTORY, /**< Path specified specifies a directory. */
SLANG_PATH_TYPE_FILE, /**< Path specified is to a file. */
};
@@ -734,7 +734,16 @@ extern "C"
SlangPathType fromPathType,
const char* fromPath,
const char* path,
- ISlangBlob** pathOut) = 0;
+ ISlangBlob** pathOut) = 0;
+
+ /** Gets the type of path that path is on the file system.
+ @param path
+ @param pathTypeOut
+ @returns SLANG_OK if located and type is known, else an error. SLANG_E_NOT_FOUND if not found.
+ */
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL getPathType(
+ const char* path,
+ SlangPathType* pathTypeOut) = 0;
};
#define SLANG_UUID_ISlangFileSystemExt { 0x5fb632d2, 0x979d, 0x4481, { 0x9f, 0xee, 0x66, 0x3c, 0x3f, 0x14, 0x49, 0xe1 } }