yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Lauro OyenMove c++ parsing code from slang-cpp-extractor to static library (#5675)eaa8dcfcc

master
864 B31 linesraw
1#pragma once
2
3#include "diagnostics.h"
4
5namespace CppParse
6{
7using namespace Slang;
8
9// A macro to define a single indent as a string
10#define CPP_EXTRACT_INDENT_STRING "    "
11
12struct FileUtil
13{
14    /// Read text into outRead. Any failures written to sink (can be passed as nullptr, for no
15    /// output)
16    static SlangResult readAllText(
17        const Slang::String& fileName,
18        DiagnosticSink* sink,
19        String& outRead);
20    /// Write text to filename. Any failures written to sink. (can be passed as nullptr, for no
21    /// output)
22    static SlangResult writeAllText(
23        const Slang::String& fileName,
24        DiagnosticSink* sink,
25        const UnownedStringSlice& text);
26
27    /// Appends CPP_EXTRACT_INDENT_STRING indentCount number of times to out
28    static void indent(Index indentCount, StringBuilder& out);
29};
30
31} // namespace CppParse