1 //===-- OptionArgParser.h ---------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef LLDB_INTERPRETER_OPTIONARGPARSER_H 11 #define LLDB_INTERPRETER_OPTIONARGPARSER_H 12 13 #include "lldb/lldb-private-types.h" 14 15 namespace lldb_private { 16 17 struct OptionArgParser { 18 static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx, 19 llvm::StringRef s, lldb::addr_t fail_value, 20 Status *error); 21 22 static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr); 23 24 static char ToChar(llvm::StringRef s, char fail_value, bool *success_ptr); 25 26 static int64_t ToOptionEnum(llvm::StringRef s, 27 const OptionEnumValues &enum_values, 28 int32_t fail_value, Status &error); 29 30 static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s, 31 lldb::ScriptLanguage fail_value, 32 bool *success_ptr); 33 34 // TODO: Use StringRef 35 static Status ToFormat(const char *s, lldb::Format &format, 36 size_t *byte_size_ptr); // If non-NULL, then a 37 // byte size can precede 38 // the format character 39 }; 40 41 } // namespace lldb_private 42 43 #endif // LLDB_INTERPRETER_OPTIONARGPARSER_H 44