LLDB  mainline
OptionValueFormat.h
Go to the documentation of this file.
1 //===-- OptionValueFormat.h -------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_INTERPRETER_OPTIONVALUEFORMAT_H
10 #define LLDB_INTERPRETER_OPTIONVALUEFORMAT_H
11 
13 
14 namespace lldb_private {
15 
17  : public Cloneable<OptionValueFormat, OptionValue> {
18 public:
20  : m_current_value(value), m_default_value(value) {}
21 
22  OptionValueFormat(lldb::Format current_value, lldb::Format default_value)
23  : m_current_value(current_value), m_default_value(default_value) {}
24 
25  ~OptionValueFormat() override = default;
26 
27  // Virtual subclass pure virtual overrides
28 
29  OptionValue::Type GetType() const override { return eTypeFormat; }
30 
31  void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
32  uint32_t dump_mask) override;
33 
34  Status
35  SetValueFromString(llvm::StringRef value,
37 
38  void Clear() override {
40  m_value_was_set = false;
41  }
42 
43  // Subclass specific functions
44 
46 
48 
49  void SetCurrentValue(lldb::Format value) { m_current_value = value; }
50 
51  void SetDefaultValue(lldb::Format value) { m_default_value = value; }
52 
53 protected:
56 };
57 
58 } // namespace lldb_private
59 
60 #endif // LLDB_INTERPRETER_OPTIONVALUEFORMAT_H
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::OptionValueFormat::GetCurrentValue
lldb::Format GetCurrentValue() const
Definition: OptionValueFormat.h:45
lldb::Format
Format
Display format definitions.
Definition: lldb-enumerations.h:155
lldb_private::Stream
Definition: Stream.h:28
lldb_private::OptionValueFormat::OptionValueFormat
OptionValueFormat(lldb::Format value)
Definition: OptionValueFormat.h:19
lldb_private::Cloneable
Definition: Cloneable.h:40
OptionValue.h
lldb_private::VarSetOperationType
VarSetOperationType
Settable state variable types.
Definition: lldb-private-enumerations.h:83
lldb_private::OptionValueFormat::DumpValue
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
Definition: OptionValueFormat.cpp:18
lldb_private::OptionValueFormat
Definition: OptionValueFormat.h:16
lldb_private::OptionValueFormat::OptionValueFormat
OptionValueFormat(lldb::Format current_value, lldb::Format default_value)
Definition: OptionValueFormat.h:22
lldb_private::OptionValueFormat::~OptionValueFormat
~OptionValueFormat() override=default
lldb_private::OptionValue::eTypeFormat
@ eTypeFormat
Definition: OptionValue.h:38
lldb_private::OptionValueFormat::GetDefaultValue
lldb::Format GetDefaultValue() const
Definition: OptionValueFormat.h:47
lldb_private::Status
Definition: Status.h:44
lldb_private::OptionValue::Type
Type
Definition: OptionValue.h:26
lldb_private::OptionValueFormat::Clear
void Clear() override
Definition: OptionValueFormat.h:38
uint32_t
lldb_private::OptionValue::m_value_was_set
bool m_value_was_set
Definition: OptionValue.h:332
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::OptionValueFormat::m_default_value
lldb::Format m_default_value
Definition: OptionValueFormat.h:55
lldb_private::OptionValueFormat::GetType
OptionValue::Type GetType() const override
Definition: OptionValueFormat.h:29
lldb_private::OptionValueFormat::SetCurrentValue
void SetCurrentValue(lldb::Format value)
Definition: OptionValueFormat.h:49
lldb_private::OptionValueFormat::m_current_value
lldb::Format m_current_value
Definition: OptionValueFormat.h:54
lldb_private::OptionValueFormat::SetDefaultValue
void SetDefaultValue(lldb::Format value)
Definition: OptionValueFormat.h:51
lldb_private::OptionValueFormat::SetValueFromString
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
Definition: OptionValueFormat.cpp:29
lldb_private::eVarSetOperationAssign
@ eVarSetOperationAssign
Definition: lldb-private-enumerations.h:90