diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /source/compiler-core/slang-source-embed-util.h | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'source/compiler-core/slang-source-embed-util.h')
| -rw-r--r-- | source/compiler-core/slang-source-embed-util.h | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/source/compiler-core/slang-source-embed-util.h b/source/compiler-core/slang-source-embed-util.h index 52115e4ef..9144bcb4c 100644 --- a/source/compiler-core/slang-source-embed-util.h +++ b/source/compiler-core/slang-source-embed-util.h @@ -2,13 +2,10 @@ #define SLANG_SOURCE_EMBED_UTIL_H #include "../core/slang-basic.h" - +#include "../core/slang-name-value.h" #include "slang-artifact.h" -#include "slang-diagnostic-sink.h" - #include "slang-com-ptr.h" - -#include "../core/slang-name-value.h" +#include "slang-diagnostic-sink.h" namespace Slang { @@ -18,42 +15,47 @@ struct SourceEmbedUtil { enum class Style : uint32_t { - None, ///< No embedding - Default, ///< Default embedding for the type - Text, ///< Embed as text. May change line endings. If output isn't text will use 'default'. Size will *not* contain terminating 0 - BinaryText, ///< Embed as text assuming contents is binary. - U8, ///< Embed as unsigned bytes - U16, ///< Embed as uint16_t - U32, ///< Embed as uint32_t - U64, ///< Embed as uint64_t + None, ///< No embedding + Default, ///< Default embedding for the type + Text, ///< Embed as text. May change line endings. If output isn't text will use 'default'. + ///< Size will *not* contain terminating 0 + BinaryText, ///< Embed as text assuming contents is binary. + U8, ///< Embed as unsigned bytes + U16, ///< Embed as uint16_t + U32, ///< Embed as uint32_t + U64, ///< Embed as uint64_t CountOf, }; struct Options { - Style style = Style::Default; ///< Style of embedding - Count lineLength = 120; ///< The line length, lines can be larger for some styles, but will aim to keep within range - SlangSourceLanguage language = SLANG_SOURCE_LANGUAGE_C; ///< The language to output for - String variableName; ///< The name to give the variable - String indent = " "; ///< Indenting + Style style = Style::Default; ///< Style of embedding + Count lineLength = 120; ///< The line length, lines can be larger for some styles, but will + ///< aim to keep within range + SlangSourceLanguage language = SLANG_SOURCE_LANGUAGE_C; ///< The language to output for + String variableName; ///< The name to give the variable + String indent = " "; ///< Indenting }; - /// Get the style infos + /// Get the style infos static ConstArrayView<NamesDescriptionValue> getStyleInfos(); - /// Given an artifact and - static SlangResult createEmbedded(IArtifact* artifact, const Options& options, ComPtr<IArtifact>& outArtifact); + /// Given an artifact and + static SlangResult createEmbedded( + IArtifact* artifact, + const Options& options, + ComPtr<IArtifact>& outArtifact); - /// Returns the default style for the desc + /// Returns the default style for the desc static Style getDefaultStyle(const ArtifactDesc& desc); - /// Returns true if supports the specified language for embedding + /// Returns true if supports the specified language for embedding static bool isSupported(SlangSourceLanguage lang); - /// Given the path return the output path. If no path is available return the empty string + /// Given the path return the output path. If no path is available return the empty string static String getPath(const String& path, const Options& options); }; -} +} // namespace Slang #endif |
