1 //===-- OptionGroupBoolean.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 liblldb_OptionGroupBoolean_h_
11 #define liblldb_OptionGroupBoolean_h_
13 #include "lldb/Interpreter/OptionValueBoolean.h"
14 #include "lldb/Interpreter/Options.h"
16 namespace lldb_private {
17 //-------------------------------------------------------------------------
19 //-------------------------------------------------------------------------
21 class OptionGroupBoolean : public OptionGroup {
23 // When 'no_argument_toggle_default' is true, then setting the option value
24 // does NOT require an argument, it sets the boolean value to the inverse of
26 OptionGroupBoolean(uint32_t usage_mask, bool required,
27 const char *long_option, int short_option,
28 const char *usage_text, bool default_value,
29 bool no_argument_toggle_default);
31 ~OptionGroupBoolean() override;
33 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
34 return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
37 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
38 ExecutionContext *execution_context) override;
39 Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
41 void OptionParsingStarting(ExecutionContext *execution_context) override;
43 OptionValueBoolean &GetOptionValue() { return m_value; }
45 const OptionValueBoolean &GetOptionValue() const { return m_value; }
48 OptionValueBoolean m_value;
49 OptionDefinition m_option_definition;
52 } // namespace lldb_private
54 #endif // liblldb_OptionGroupBoolean_h_