]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionValueFormatEntity.h
MFV r304732.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Interpreter / OptionValueFormatEntity.h
1 //===-- OptionValueFormatEntity.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_OptionValueFormatEntity_h_
11 #define liblldb_OptionValueFormatEntity_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Core/FormatEntity.h"
18 #include "lldb/Interpreter/OptionValue.h"
19
20 namespace lldb_private {
21
22 class OptionValueFormatEntity : public OptionValue
23 {
24 public:
25     OptionValueFormatEntity (const char *default_format);
26     
27     ~OptionValueFormatEntity() override
28     {
29     }
30     
31     //---------------------------------------------------------------------
32     // Virtual subclass pure virtual overrides
33     //---------------------------------------------------------------------
34     
35     OptionValue::Type
36     GetType () const override
37     {
38         return eTypeFormatEntity;
39     }
40     
41     void
42     DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override;
43     
44     Error
45     SetValueFromString (llvm::StringRef value,
46                          VarSetOperationType op = eVarSetOperationAssign) override;
47     
48     bool
49     Clear () override;
50     
51     lldb::OptionValueSP
52     DeepCopy () const override;
53
54     size_t
55     AutoComplete (CommandInterpreter &interpreter,
56                   const char *s,
57                   int match_start_point,
58                   int max_return_elements,
59                   bool &word_complete,
60                   StringList &matches) override;
61
62     //---------------------------------------------------------------------
63     // Subclass specific functions
64     //---------------------------------------------------------------------
65     
66     FormatEntity::Entry &
67     GetCurrentValue()
68     {
69         return m_current_entry;
70     }
71     
72     const FormatEntity::Entry &
73     GetCurrentValue() const
74     {
75         return m_current_entry;
76     }
77     
78     void
79     SetCurrentValue (const FormatEntity::Entry &value)
80     {
81         m_current_entry = value;
82     }
83
84     FormatEntity::Entry &
85     GetDefaultValue()
86     {
87         return m_default_entry;
88     }
89     
90     const FormatEntity::Entry &
91     GetDefaultValue() const
92     {
93         return m_default_entry;
94     }
95
96 protected:
97     std::string m_current_format;
98     std::string m_default_format;
99     FormatEntity::Entry m_current_entry;
100     FormatEntity::Entry m_default_entry;
101 };
102
103 } // namespace lldb_private
104
105 #endif // liblldb_OptionValueFormatEntity_h_