]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionValueFormat.h
Upgrade to OpenSSH 7.2p2.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Interpreter / OptionValueFormat.h
1 //===-- OptionValueFormat.h -------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_OptionValueFormat_h_
11 #define liblldb_OptionValueFormat_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Interpreter/OptionValue.h"
18
19 namespace lldb_private {
20
21 class OptionValueFormat : public OptionValue
22 {
23 public:
24     OptionValueFormat (lldb::Format value) :
25         OptionValue(),
26         m_current_value (value),
27         m_default_value (value)
28     {
29     }
30
31     OptionValueFormat (lldb::Format current_value,
32                        lldb::Format default_value) :
33         OptionValue(),
34         m_current_value (current_value),
35         m_default_value (default_value)
36     {
37     }
38     
39     ~OptionValueFormat() override
40     {
41     }
42     
43     //---------------------------------------------------------------------
44     // Virtual subclass pure virtual overrides
45     //---------------------------------------------------------------------
46     
47     OptionValue::Type
48     GetType() const override
49     {
50         return eTypeFormat;
51     }
52     
53     void
54     DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override;
55     
56     Error
57     SetValueFromString(llvm::StringRef value,
58                        VarSetOperationType op = eVarSetOperationAssign) override;
59     
60     bool
61     Clear() override
62     {
63         m_current_value = m_default_value;
64         m_value_was_set = false;
65         return true;
66     }
67
68     lldb::OptionValueSP
69     DeepCopy() const override;
70     
71     //---------------------------------------------------------------------
72     // Subclass specific functions
73     //---------------------------------------------------------------------
74     
75     lldb::Format
76     GetCurrentValue() const
77     {
78         return m_current_value;
79     }
80     
81     lldb::Format 
82     GetDefaultValue() const
83     {
84         return m_default_value;
85     }
86     
87     void
88     SetCurrentValue (lldb::Format value)
89     {
90         m_current_value = value;
91     }
92     
93     void
94     SetDefaultValue (lldb::Format value)
95     {
96         m_default_value = value;
97     }
98     
99 protected:
100     lldb::Format m_current_value;
101     lldb::Format m_default_value;
102 };
103
104 } // namespace lldb_private
105
106 #endif // liblldb_OptionValueFormat_h_