1 //===-- OptionValueUInt64.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_OptionValueUInt64_h_
11 #define liblldb_OptionValueUInt64_h_
15 // Other libraries and framework includes
17 #include "lldb/Interpreter/OptionValue.h"
19 namespace lldb_private {
21 class OptionValueUInt64 : public OptionValue
24 OptionValueUInt64 () :
31 OptionValueUInt64 (uint64_t value) :
33 m_current_value (value),
34 m_default_value (value)
38 OptionValueUInt64 (uint64_t current_value,
39 uint64_t default_value) :
41 m_current_value (current_value),
42 m_default_value (default_value)
51 //---------------------------------------------------------------------
52 // Decode a uint64_t from "value_cstr" return a OptionValueUInt64 object
53 // inside of a lldb::OptionValueSP object if all goes well. If the
54 // string isn't a uint64_t value or any other error occurs, return an
55 // empty lldb::OptionValueSP and fill error in with the correct stuff.
56 //---------------------------------------------------------------------
57 static lldb::OptionValueSP
58 Create (const char *value_cstr, Error &error);
59 //---------------------------------------------------------------------
60 // Virtual subclass pure virtual overrides
61 //---------------------------------------------------------------------
63 virtual OptionValue::Type
70 DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
73 SetValueFromCString (const char *value,
74 VarSetOperationType op = eVarSetOperationAssign);
79 m_current_value = m_default_value;
80 m_value_was_set = false;
84 virtual lldb::OptionValueSP
87 //---------------------------------------------------------------------
88 // Subclass specific functions
89 //---------------------------------------------------------------------
92 operator = (uint64_t value)
94 m_current_value = value;
95 return m_current_value;
98 operator uint64_t () const
100 return m_current_value;
104 GetCurrentValue() const
106 return m_current_value;
110 GetDefaultValue() const
112 return m_default_value;
116 SetCurrentValue (uint64_t value)
118 m_current_value = value;
122 SetDefaultValue (uint64_t value)
124 m_default_value = value;
128 uint64_t m_current_value;
129 uint64_t m_default_value;
132 } // namespace lldb_private
134 #endif // liblldb_OptionValueUInt64_h_