Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame] | 1 | //===-- OptionGroupString.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 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame^] | 9 | #ifndef LLDB_INTERPRETER_OPTIONGROUPSTRING_H |
| 10 | #define LLDB_INTERPRETER_OPTIONGROUPSTRING_H |
Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame] | 11 | |
| 12 | #include "lldb/Interpreter/OptionValueString.h" |
| 13 | #include "lldb/Interpreter/Options.h" |
| 14 | |
| 15 | namespace lldb_private { |
| 16 | // OptionGroupString |
| 17 | |
| 18 | class OptionGroupString : public OptionGroup { |
| 19 | public: |
| 20 | OptionGroupString(uint32_t usage_mask, bool required, const char *long_option, |
| 21 | int short_option, uint32_t completion_type, |
| 22 | lldb::CommandArgumentType argument_type, |
| 23 | const char *usage_text, const char *default_value); |
| 24 | |
| 25 | ~OptionGroupString() override; |
| 26 | |
| 27 | llvm::ArrayRef<OptionDefinition> GetDefinitions() override { |
| 28 | return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1); |
| 29 | } |
| 30 | |
| 31 | Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, |
| 32 | ExecutionContext *execution_context) override; |
| 33 | Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete; |
| 34 | |
| 35 | void OptionParsingStarting(ExecutionContext *execution_context) override; |
| 36 | |
| 37 | OptionValueString &GetOptionValue() { return m_value; } |
| 38 | |
| 39 | const OptionValueString &GetOptionValue() const { return m_value; } |
| 40 | |
| 41 | protected: |
| 42 | OptionValueString m_value; |
| 43 | OptionDefinition m_option_definition; |
| 44 | }; |
| 45 | |
| 46 | } // namespace lldb_private |
| 47 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame^] | 48 | #endif // LLDB_INTERPRETER_OPTIONGROUPSTRING_H |