Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:50

0001 //===-- OptionGroupBoolean.h ------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_INTERPRETER_OPTIONGROUPBOOLEAN_H
0010 #define LLDB_INTERPRETER_OPTIONGROUPBOOLEAN_H
0011 
0012 #include "lldb/Interpreter/OptionValueBoolean.h"
0013 #include "lldb/Interpreter/Options.h"
0014 
0015 namespace lldb_private {
0016 // OptionGroupBoolean
0017 
0018 class OptionGroupBoolean : public OptionGroup {
0019 public:
0020   // When 'no_argument_toggle_default' is true, then setting the option value
0021   // does NOT require an argument, it sets the boolean value to the inverse of
0022   // the default value
0023   OptionGroupBoolean(uint32_t usage_mask, bool required,
0024                      const char *long_option, int short_option,
0025                      const char *usage_text, bool default_value,
0026                      bool no_argument_toggle_default);
0027 
0028   ~OptionGroupBoolean() override = default;
0029 
0030   llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
0031     return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);
0032   }
0033 
0034   Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
0035                         ExecutionContext *execution_context) override;
0036 
0037   void OptionParsingStarting(ExecutionContext *execution_context) override;
0038 
0039   OptionValueBoolean &GetOptionValue() { return m_value; }
0040 
0041   const OptionValueBoolean &GetOptionValue() const { return m_value; }
0042 
0043 protected:
0044   OptionValueBoolean m_value;
0045   OptionDefinition m_option_definition;
0046 };
0047 
0048 } // namespace lldb_private
0049 
0050 #endif // LLDB_INTERPRETER_OPTIONGROUPBOOLEAN_H