diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-10-16 18:49:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-16 18:49:11 -0400 |
| commit | 3e74d39f24fdfaa547ce900be177863e2bfe2dea (patch) | |
| tree | 9a5143e6de4caa27b23fc870003011e96129905f /source/slang/preprocessor.h | |
| parent | 204fb3c75b520a2cbb1c25f995a8c424ec2753f3 (diff) | |
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 <windows.h> 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.
Diffstat (limited to 'source/slang/preprocessor.h')
| -rw-r--r-- | source/slang/preprocessor.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/source/slang/preprocessor.h b/source/slang/preprocessor.h index 0e30038bf..42a3b25f4 100644 --- a/source/slang/preprocessor.h +++ b/source/slang/preprocessor.h @@ -11,22 +11,17 @@ class DiagnosticSink; class ModuleDecl; class TranslationUnitRequest; -enum class IncludeResult -{ - Error, - NotFound, - Found, -}; - // Callback interface for the preprocessor to use when looking // for files in `#include` directives. struct IncludeHandler { - virtual IncludeResult TryToFindIncludeFile( - String const& pathToInclude, - String const& pathIncludedFrom, - String* outFoundPath, - ISlangBlob** outFoundSourceBlob) = 0; + + virtual SlangResult findFile(const String& pathToInclude, + const String& pathIncludedFrom, + PathInfo& pathInfoOut) = 0; + + virtual SlangResult readFile(const String& path, + ISlangBlob** blobOut) = 0; }; // Take a string of source code and preprocess it into a list of tokens. |
