]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionGroupBoolean.h
Import DTS files from Linux 4.18
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Interpreter / OptionGroupBoolean.h
1 //===-- OptionGroupBoolean.h ------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_OptionGroupBoolean_h_
11 #define liblldb_OptionGroupBoolean_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Interpreter/OptionValueBoolean.h"
18 #include "lldb/Interpreter/Options.h"
19
20 namespace lldb_private {
21 //-------------------------------------------------------------------------
22 // OptionGroupBoolean
23 //-------------------------------------------------------------------------
24
25 class OptionGroupBoolean : public OptionGroup {
26 public:
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);
34
35   ~OptionGroupBoolean() override;
36
37   llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
38     return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
39   }
40
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;
44
45   void OptionParsingStarting(ExecutionContext *execution_context) override;
46
47   OptionValueBoolean &GetOptionValue() { return m_value; }
48
49   const OptionValueBoolean &GetOptionValue() const { return m_value; }
50
51 protected:
52   OptionValueBoolean m_value;
53   OptionDefinition m_option_definition;
54 };
55
56 } // namespace lldb_private
57
58 #endif // liblldb_OptionGroupBoolean_h_