File indexing completed on 2026-05-10 08:42:50
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_INTERPRETER_OPTIONVALUEBOOLEAN_H
0010 #define LLDB_INTERPRETER_OPTIONVALUEBOOLEAN_H
0011
0012 #include "lldb/Interpreter/OptionValue.h"
0013
0014 namespace lldb_private {
0015
0016 class OptionValueBoolean : public Cloneable<OptionValueBoolean, OptionValue> {
0017 public:
0018 OptionValueBoolean(bool value)
0019 : m_current_value(value), m_default_value(value) {}
0020 OptionValueBoolean(bool current_value, bool default_value)
0021 : m_current_value(current_value), m_default_value(default_value) {}
0022
0023 ~OptionValueBoolean() override = default;
0024
0025
0026
0027 OptionValue::Type GetType() const override { return eTypeBoolean; }
0028
0029 void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
0030 uint32_t dump_mask) override;
0031
0032 llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override {
0033 return m_current_value;
0034 }
0035
0036 Status
0037 SetValueFromString(llvm::StringRef value,
0038 VarSetOperationType op = eVarSetOperationAssign) override;
0039
0040 void Clear() override {
0041 m_current_value = m_default_value;
0042 m_value_was_set = false;
0043 }
0044
0045 void AutoComplete(CommandInterpreter &interpreter,
0046 CompletionRequest &request) override;
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063 explicit operator bool() const { return m_current_value; }
0064
0065 const bool &operator=(bool b) {
0066 m_current_value = b;
0067 return m_current_value;
0068 }
0069
0070 bool GetCurrentValue() const { return m_current_value; }
0071
0072 bool GetDefaultValue() const { return m_default_value; }
0073
0074 void SetCurrentValue(bool value) { m_current_value = value; }
0075
0076 void SetDefaultValue(bool value) { m_default_value = value; }
0077
0078 protected:
0079 bool m_current_value;
0080 bool m_default_value;
0081 };
0082
0083 }
0084
0085 #endif