1 //===-- OptionValueFormat.h -------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_OptionValueFormat_h_
11 #define liblldb_OptionValueFormat_h_
15 // Other libraries and framework includes
17 #include "lldb/Interpreter/OptionValue.h"
19 namespace lldb_private {
21 class OptionValueFormat : public OptionValue
24 OptionValueFormat (lldb::Format value) :
26 m_current_value (value),
27 m_default_value (value)
31 OptionValueFormat (lldb::Format current_value,
32 lldb::Format default_value) :
34 m_current_value (current_value),
35 m_default_value (default_value)
39 ~OptionValueFormat() override
43 //---------------------------------------------------------------------
44 // Virtual subclass pure virtual overrides
45 //---------------------------------------------------------------------
48 GetType() const override
54 DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override;
57 SetValueFromString(llvm::StringRef value,
58 VarSetOperationType op = eVarSetOperationAssign) override;
63 m_current_value = m_default_value;
64 m_value_was_set = false;
69 DeepCopy() const override;
71 //---------------------------------------------------------------------
72 // Subclass specific functions
73 //---------------------------------------------------------------------
76 GetCurrentValue() const
78 return m_current_value;
82 GetDefaultValue() const
84 return m_default_value;
88 SetCurrentValue (lldb::Format value)
90 m_current_value = value;
94 SetDefaultValue (lldb::Format value)
96 m_default_value = value;
100 lldb::Format m_current_value;
101 lldb::Format m_default_value;
104 } // namespace lldb_private
106 #endif // liblldb_OptionValueFormat_h_