From 3e74d39f24fdfaa547ce900be177863e2bfe2dea Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 16 Oct 2018 18:49:11 -0400 Subject: Feature/include refactor (#675) * Refactor of path handling. * Added PathInfo * Changed ISlangFileSystem - such that has separate concepts of reading a file, getting a relative path and getting a canonical path * Added support for getting a canonical path for windows/linux * Made maps/testing around canonicalPaths * User output remains around 'foundPath' - which is the same as before * Small improvements around PathInfo * Added a type and make constructors to make clear the different 'path' uses * Fixed bug in findViewRecursively * Checking and reporting for ignored #pragma once. * Removed SLANG_PATH_TYPE_NONE as doesn't serve any useful purpose. * Improve comments in slang.h aroung ISlangFileSystem * Remove the need for in slang-io.cpp * Ran premake5. * Improvements and fixes around PathInfo. * Fix typo on linix GetCanonical * Make the ISlangFileSystem the same as before, and ISlangFileSystem contain the new methods. Internally it always uses the ISlangFileSystemExt, and will wrap a ISlangFileSystem with WrapFileSystem, if it is determined (via queryInterface) that it doesn't implement the full interface. --- source/slang/compiler.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source/slang/compiler.h') diff --git a/source/slang/compiler.h b/source/slang/compiler.h index a83d8b334..04508837f 100644 --- a/source/slang/compiler.h +++ b/source/slang/compiler.h @@ -13,6 +13,7 @@ namespace Slang { + struct PathInfo; struct IncludeHandler; class CompileRequest; class ProgramLayout; @@ -395,6 +396,11 @@ namespace Slang /// ComPtr fileSystem; + /// The extended file system implementation. Will be set to a default implementation + /// if fileSystem is nullptr. Otherwise it will either be fileSystem's interface, + /// or a wrapped impl that makes fileSystem operate as fileSystemExt + ComPtr fileSystemExt; + /// Load a file into memory using the configured file system. /// /// @param path The path to attempt to load from @@ -454,14 +460,14 @@ namespace Slang RefPtr loadModule( Name* name, - String const& path, - ISlangBlob* sourceBlob, + const PathInfo& filePathInfo, + ISlangBlob* fileContentsBlob, SourceLoc const& loc); void loadParsedModule( RefPtr const& translationUnit, Name* name, - String const& path); + PathInfo const& pathInfo); RefPtr findOrImportModule( Name* name, -- cgit v1.2.3