yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
eaa8dcfcc
master
1#pragma once 2 3#include "slang/slang-diagnostics.h" 4 5namespace CppParse 6{ 7using namespace Slang ; 8 9 10// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Options !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 11 12struct Options 13{ 14void reset () {* this = Options (); } 15 16Options () 17 { 18m_markPrefix = "SLANG_" ; 19m_markSuffix = "_CLASS" ; 20 } 21 22bool m_defs = false;///< If set will output a '-defs.h' file for each of the input files, that 23///< corresponds to previous defs files (although doesn't have fields/RAW) 24bool m_dump = 25 false;///< If true will dump to stderr the types/fields and hierarchy it extracted 26bool m_runUnitTests = false;///< If true will run internal unit tests 27bool m_extractDoc = true;///< If set will try to extract documentation associated with nodes 28 29bool m_outputFields = false;///< When dumping macros also dump field definitions 30bool m_requireMark = true; 31 32List < String > m_inputPaths ;///< The input paths to the files to be processed 33 34String m_outputPath ;///< The output path. Note that the extractor can generate multiple output 35///< files, and this will actually be the 'stem' of several files 36 37String m_inputDirectory ;///< The input directory that is by default used for reading 38///< m_inputPaths from. 39String m_markPrefix ;///< The prefix of the 'marker' used to identify a reflected type 40String m_markSuffix ;///< The postfix of the 'marker' used to identify a reflected type 41String m_stripFilePrefix ;///< Used for the 'origin' information, this is stripped from the 42///< source filename, and the remainder of the filename (without 43///< extension) is 'macroized' 44}; 45 46struct OptionsParser 47{ 48/// Parse the parameters. NOTE! Must have the program path removed 49SlangResult parse (int argc ,const char * const * argv ,DiagnosticSink * sink ,Options & outOptions ); 50 51SlangResult _parseArgWithValue (const char * option ,String & outValue ); 52SlangResult _parseArgReplaceValue (const char * option ,String & outValue ); 53SlangResult _parseArgFlag (const char * option ,bool & outFlag ); 54 55String m_reflectType ; 56 57Index m_index ; 58Int m_argCount ; 59const char * const * m_args ; 60DiagnosticSink * m_sink ; 61}; 62 63}// namespace CppParse