OptionArgParser.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //===-- OptionArgParser.h ---------------------------------------*- C++ -*-===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLDB_INTERPRETER_OPTIONARGPARSER_H
  9. #define LLDB_INTERPRETER_OPTIONARGPARSER_H
  10. #include "lldb/lldb-private-types.h"
  11. namespace lldb_private {
  12. struct OptionArgParser {
  13. static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx,
  14. llvm::StringRef s, lldb::addr_t fail_value,
  15. Status *error);
  16. static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr);
  17. static char ToChar(llvm::StringRef s, char fail_value, bool *success_ptr);
  18. static int64_t ToOptionEnum(llvm::StringRef s,
  19. const OptionEnumValues &enum_values,
  20. int32_t fail_value, Status &error);
  21. static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s,
  22. lldb::ScriptLanguage fail_value,
  23. bool *success_ptr);
  24. // TODO: Use StringRef
  25. static Status ToFormat(const char *s, lldb::Format &format,
  26. size_t *byte_size_ptr); // If non-NULL, then a
  27. // byte size can precede
  28. // the format character
  29. };
  30. } // namespace lldb_private
  31. #endif // LLDB_INTERPRETER_OPTIONARGPARSER_H