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_
15 // Other libraries and framework includes
17 #include "lldb/Interpreter/OptionValueBoolean.h"
18 #include "lldb/Interpreter/Options.h"
20 namespace lldb_private {
21 //-------------------------------------------------------------------------
23 //-------------------------------------------------------------------------
25 class OptionGroupBoolean : public OptionGroup {
27 // When 'no_argument_toggle_default' is true, then setting the option
28 // value does NOT require an argument, it sets the boolean value to the
29 // inverse of the default value
30 OptionGroupBoolean(uint32_t usage_mask, bool required,
31 const char *long_option, int short_option,
32 const char *usage_text, bool default_value,
33 bool no_argument_toggle_default);
35 ~OptionGroupBoolean() override;
37 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
38 return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
41 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
42 ExecutionContext *execution_context) override;
43 Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
45 void OptionParsingStarting(ExecutionContext *execution_context) override;
47 OptionValueBoolean &GetOptionValue() { return m_value; }
49 const OptionValueBoolean &GetOptionValue() const { return m_value; }
52 OptionValueBoolean m_value;
53 OptionDefinition m_option_definition;
56 } // namespace lldb_private
58 #endif // liblldb_OptionGroupBoolean_h_