aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Interpreter/OptionGroupBoolean.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Interpreter/OptionGroupBoolean.h')
-rw-r--r--include/lldb/Interpreter/OptionGroupBoolean.h90
1 files changed, 34 insertions, 56 deletions
diff --git a/include/lldb/Interpreter/OptionGroupBoolean.h b/include/lldb/Interpreter/OptionGroupBoolean.h
index 881a1bdf4be6..931a6d73e728 100644
--- a/include/lldb/Interpreter/OptionGroupBoolean.h
+++ b/include/lldb/Interpreter/OptionGroupBoolean.h
@@ -14,66 +14,44 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Interpreter/Options.h"
#include "lldb/Interpreter/OptionValueBoolean.h"
+#include "lldb/Interpreter/Options.h"
namespace lldb_private {
- //-------------------------------------------------------------------------
- // OptionGroupBoolean
- //-------------------------------------------------------------------------
-
- class OptionGroupBoolean : public OptionGroup
- {
- public:
- // When 'no_argument_toggle_default' is true, then setting the option
- // value does NOT require an argument, it sets the boolean value to the
- // inverse of the default value
- OptionGroupBoolean (uint32_t usage_mask,
- bool required,
- const char *long_option,
- int short_option,
- const char *usage_text,
- bool default_value,
- bool no_argument_toggle_default);
-
- ~OptionGroupBoolean() override;
+//-------------------------------------------------------------------------
+// OptionGroupBoolean
+//-------------------------------------------------------------------------
+
+class OptionGroupBoolean : public OptionGroup {
+public:
+ // When 'no_argument_toggle_default' is true, then setting the option
+ // value does NOT require an argument, it sets the boolean value to the
+ // inverse of the default value
+ OptionGroupBoolean(uint32_t usage_mask, bool required,
+ const char *long_option, int short_option,
+ const char *usage_text, bool default_value,
+ bool no_argument_toggle_default);
+
+ ~OptionGroupBoolean() override;
+
+ llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
+ return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
+ }
+
+ Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
+ ExecutionContext *execution_context) override;
+ Error SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
+
+ void OptionParsingStarting(ExecutionContext *execution_context) override;
+
+ OptionValueBoolean &GetOptionValue() { return m_value; }
+
+ const OptionValueBoolean &GetOptionValue() const { return m_value; }
- uint32_t
- GetNumDefinitions() override
- {
- return 1;
- }
-
- const OptionDefinition*
- GetDefinitions() override
- {
- return &m_option_definition;
- }
-
- Error
- SetOptionValue(CommandInterpreter &interpreter,
- uint32_t option_idx,
- const char *option_value) override;
-
- void
- OptionParsingStarting(CommandInterpreter &interpreter) override;
-
- OptionValueBoolean &
- GetOptionValue ()
- {
- return m_value;
- }
-
- const OptionValueBoolean &
- GetOptionValue () const
- {
- return m_value;
- }
-
- protected:
- OptionValueBoolean m_value;
- OptionDefinition m_option_definition;
- };
+protected:
+ OptionValueBoolean m_value;
+ OptionDefinition m_option_definition;
+};
} // namespace lldb_private