1 //===-- OptionArgParser.h ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_INTERPRETER_OPTIONARGPARSER_H
11 #define LLDB_INTERPRETER_OPTIONARGPARSER_H
13 #include "lldb/lldb-private-types.h"
15 namespace lldb_private {
17 struct OptionArgParser {
18 static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx,
19 llvm::StringRef s, lldb::addr_t fail_value,
22 static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr);
24 static char ToChar(llvm::StringRef s, char fail_value, bool *success_ptr);
26 static int64_t ToOptionEnum(llvm::StringRef s,
27 OptionEnumValueElement *enum_values,
28 int32_t fail_value, Status &error);
30 static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s,
31 lldb::ScriptLanguage fail_value,
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
41 } // namespace lldb_private
43 #endif // LLDB_INTERPRETER_OPTIONARGPARSER_H