本文整理匯總了C#中ASTContext.GenerateEnumFromMacros方法的典型用法代碼示例。如果您正苦於以下問題:C# ASTContext.GenerateEnumFromMacros方法的具體用法?C# ASTContext.GenerateEnumFromMacros怎麽用?C# ASTContext.GenerateEnumFromMacros使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ASTContext
的用法示例。
在下文中一共展示了ASTContext.GenerateEnumFromMacros方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Preprocess
public void Preprocess(Driver driver, ASTContext ctx)
{
ctx.IgnoreEnumWithMatchingItem("SDL_FALSE");
ctx.IgnoreEnumWithMatchingItem("DUMMY_ENUM_VALUE");
ctx.SetNameOfEnumWithMatchingItem("SDL_SCANCODE_UNKNOWN", "ScanCode");
ctx.SetNameOfEnumWithMatchingItem("SDLK_UNKNOWN", "Key");
ctx.SetNameOfEnumWithMatchingItem("KMOD_NONE", "KeyModifier");
ctx.SetNameOfEnumWithMatchingItem("SDL_LOG_CATEGORY_CUSTOM", "LogCategory");
ctx.GenerateEnumFromMacros("InitFlags", "SDL_INIT_(.*)").SetFlags();
ctx.GenerateEnumFromMacros("Endianness", "SDL_(.*)_ENDIAN");
ctx.GenerateEnumFromMacros("InputState", "SDL_RELEASED", "SDL_PRESSED");
ctx.GenerateEnumFromMacros("AlphaState", "SDL_ALPHA_(.*)");
ctx.GenerateEnumFromMacros("HatState", "SDL_HAT_(.*)");
ctx.IgnoreHeadersWithName("SDL_atomic*");
ctx.IgnoreHeadersWithName("SDL_endian*");
ctx.IgnoreHeadersWithName("SDL_main*");
ctx.IgnoreHeadersWithName("SDL_mutex*");
ctx.IgnoreHeadersWithName("SDL_stdinc*");
ctx.IgnoreHeadersWithName("SDL_error");
ctx.IgnoreEnumWithMatchingItem("SDL_ENOMEM");
ctx.IgnoreFunctionWithName("SDL_Error");
}
示例2: Preprocess
public void Preprocess(Driver driver, ASTContext ctx)
{
ctx.IgnoreHeadersWithName("lldb/lldb-forward.h");
ctx.IgnoreHeadersWithName("lldb/API/SBDefines.h");
ctx.SetMethodParameterUsage("lldb::SBTarget", "Launch", 2, 2, ParameterUsage.Out);
ctx.SetMethodParameterUsage("lldb::SBTarget", "Launch", 10, 10, ParameterUsage.Out);
ctx.RemoveEnumItemsPrefix("lldb::StateType", "eState");
ctx.RemoveEnumItemsPrefix("lldb::LaunchFlags", "eLaunchFlag");
ctx.RemoveEnumItemsPrefix("lldb::RunMode", "e");
ctx.RemoveEnumItemsPrefix("lldb::ExpressionResults", "eExpression");
ctx.RemoveEnumItemsPrefix("lldb::SymbolContextItem", "eSymbolContext");
ctx.RemoveEnumItemsPrefix("lldb::InputReaderAction", "eInputReader");
ctx.RemoveEnumItemsPrefix("lldb::DynamicValueType", "e");
ctx.RemoveEnumItemsPrefix("lldb::InputReaderAction", "eInputReader");
ctx.RemoveEnumItemsPrefix("lldb::AccessType", "eAccess");
ctx.RemoveEnumItemsPrefix("lldb::CommandArgumentType", "eArgType");
ctx.RemoveEnumItemsPrefix("lldb::EmulateInstructionOptions", "eEmulateInstructionOption");
ctx.RemoveEnumItemsPrefix("lldb::TypeOptions", "eTypeOption");
ctx.RemoveEnumItemsPrefix("lldb::FrameComparison", "eFrameCompare");
ctx.RemoveEnumItemsPrefix("lldb::ExpressionEvaluationPhase", "eExpressionEvaluation");
ctx.RemoveEnumItemsPrefix("lldb::TypeFlags", "eType");
ctx.RemoveEnumItemsPrefix("lldb::CommandFlags", "eCommand");
ctx.RemoveEnumItemsPrefix("lldb::TypeSummaryCapping", "eTypeSummary");
ctx.SetNameOfClassMethod("lldb::SBError", "GetError", "GetErrorCode");
ctx.SetNameOfClassMethod("lldb::SBValue", "GetValue", "GetValueAsString");
ctx.GenerateEnumFromMacros("BreakpointId", "LLDB_BREAK_*", "LLDB_INVALID_BREAK_ID",
"LLDB_DEFAULT_BREAK_SIZE");
ctx.GenerateEnumFromMacros("WatchpointId", "LLDB_WATCH_*", "LLDB_INVALID_WATCH_ID");
ctx.GenerateEnumFromMacros("GenericRegister", "LLDB_REGNUM_GENERIC_*");
ctx.GenerateEnumFromMacros("InvalidValue", "LLDB_INVALID_*");
ctx.GenerateEnumFromMacros("CPUType", "LLDB_ARCH_*", "LLDB_INVALID_CPUTYPE");
ctx.GenerateEnumFromMacros("OptionSet", "LDB_OPT_SET_*", "LLDB_MAX_NUM_OPTION_SETS");
ctx.RenameNamespace("lldb", "LLDB");
}