1 //===-- OptionArgParser.h ---------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_INTERPRETER_OPTIONARGPARSER_H
10 #define LLDB_INTERPRETER_OPTIONARGPARSER_H
12 #include "lldb/lldb-private-types.h"
14 namespace lldb_private {
16 struct OptionArgParser {
17 static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx,
18 llvm::StringRef s, lldb::addr_t fail_value,
21 static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr);
23 static char ToChar(llvm::StringRef s, char fail_value, bool *success_ptr);
25 static int64_t ToOptionEnum(llvm::StringRef s,
26 const OptionEnumValues &enum_values,
27 int32_t fail_value, Status &error);
29 static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s,
30 lldb::ScriptLanguage fail_value,
33 // TODO: Use StringRef
34 static Status ToFormat(const char *s, lldb::Format &format,
35 size_t *byte_size_ptr); // If non-NULL, then a
36 // byte size can precede
37 // the format character
40 } // namespace lldb_private
42 #endif // LLDB_INTERPRETER_OPTIONARGPARSER_H