1 //===-- OptionGroupBoolean.h ------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_OptionGroupBoolean_h_
10 #define liblldb_OptionGroupBoolean_h_
12 #include "lldb/Interpreter/OptionValueBoolean.h"
13 #include "lldb/Interpreter/Options.h"
15 namespace lldb_private {
18 class OptionGroupBoolean : public OptionGroup {
20 // When 'no_argument_toggle_default' is true, then setting the option value
21 // does NOT require an argument, it sets the boolean value to the inverse of
23 OptionGroupBoolean(uint32_t usage_mask, bool required,
24 const char *long_option, int short_option,
25 const char *usage_text, bool default_value,
26 bool no_argument_toggle_default);
28 ~OptionGroupBoolean() override;
30 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
31 return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
34 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
35 ExecutionContext *execution_context) override;
36 Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
38 void OptionParsingStarting(ExecutionContext *execution_context) override;
40 OptionValueBoolean &GetOptionValue() { return m_value; }
42 const OptionValueBoolean &GetOptionValue() const { return m_value; }
45 OptionValueBoolean m_value;
46 OptionDefinition m_option_definition;
49 } // namespace lldb_private
51 #endif // liblldb_OptionGroupBoolean_h_