From 9b80537bc0272a9caf93f146d8964d9bdd4a407e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 4 Feb 2019 17:30:51 -0500 Subject: Feature/view path (#824) * Use 'is' over 'as' where appropriate. * dynamic_cast -> dynamicCast * Replace 'dynamicCast' with 'as' where has no change in behavior/ambiguity. * Replace dynamicCast with as where doesn't change behavior/non ambiguous. * Keep a per view path to the file loaded - such that diagnostic messages always display the path to the requested file. * Add simplifyPath to ISlangFileSystemExt Simplify (if possible) paths that are set on SourceFile and SourcView - doing so makes reading paths simpler. * Fix small typo. * Improve documentation in source for getFileUniqueIdentity * Fix override warning. --- source/slang/slang.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index e332ef588..16dfe8618 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -176,6 +176,17 @@ struct IncludeHandlerImpl : IncludeHandler return SLANG_OK; } + virtual String simplifyPath(const String& path) override + { + ISlangFileSystemExt* fileSystemExt = _getFileSystemExt(); + ComPtr simplifiedPath; + if (SLANG_FAILED(fileSystemExt->getSimplifiedPath(path.Buffer(), simplifiedPath.writeRef()))) + { + return path; + } + return StringUtil::getString(simplifiedPath); + } + }; // -- cgit v1.2.3