]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionValueFormatEntity.h
Merge clang 7.0.1 and several follow-up changes
[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 public:
24   OptionValueFormatEntity(const char *default_format);
25
26   ~OptionValueFormatEntity() override {}
27
28   //---------------------------------------------------------------------
29   // Virtual subclass pure virtual overrides
30   //---------------------------------------------------------------------
31
32   OptionValue::Type GetType() const override { return eTypeFormatEntity; }
33
34   void DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
35                  uint32_t dump_mask) override;
36
37   Status
38   SetValueFromString(llvm::StringRef value,
39                      VarSetOperationType op = eVarSetOperationAssign) override;
40   Status
41   SetValueFromString(const char *,
42                      VarSetOperationType = eVarSetOperationAssign) = delete;
43
44   bool Clear() override;
45
46   lldb::OptionValueSP DeepCopy() const override;
47
48   size_t AutoComplete(CommandInterpreter &interpreter,
49                       CompletionRequest &request) override;
50
51   //---------------------------------------------------------------------
52   // Subclass specific functions
53   //---------------------------------------------------------------------
54
55   FormatEntity::Entry &GetCurrentValue() { return m_current_entry; }
56
57   const FormatEntity::Entry &GetCurrentValue() const { return m_current_entry; }
58
59   void SetCurrentValue(const FormatEntity::Entry &value) {
60     m_current_entry = value;
61   }
62
63   FormatEntity::Entry &GetDefaultValue() { return m_default_entry; }
64
65   const FormatEntity::Entry &GetDefaultValue() const { return m_default_entry; }
66
67 protected:
68   std::string m_current_format;
69   std::string m_default_format;
70   FormatEntity::Entry m_current_entry;
71   FormatEntity::Entry m_default_entry;
72 };
73
74 } // namespace lldb_private
75
76 #endif // liblldb_OptionValueFormatEntity_h_