]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/UserSettingsController.h
Merge ^/head r317971 through r318379.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / UserSettingsController.h
1 //====-- UserSettingsController.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_UserSettingsController_h_
11 #define liblldb_UserSettingsController_h_
12
13 #include "lldb/Utility/Error.h"             // for Error
14 #include "lldb/lldb-forward.h"              // for OptionValuePropertiesSP
15 #include "lldb/lldb-private-enumerations.h" // for VarSetOperationType
16
17 #include "llvm/ADT/StringRef.h" // for StringRef
18
19 #include <vector>
20
21 #include <stddef.h> // for size_t
22 #include <stdint.h> // for uint32_t
23
24 namespace lldb_private {
25 class CommandInterpreter;
26 }
27 namespace lldb_private {
28 class ConstString;
29 }
30 namespace lldb_private {
31 class ExecutionContext;
32 }
33 namespace lldb_private {
34 class Property;
35 }
36 namespace lldb_private {
37 class Stream;
38 }
39
40 namespace lldb_private {
41
42 class Properties {
43 public:
44   Properties() : m_collection_sp() {}
45
46   Properties(const lldb::OptionValuePropertiesSP &collection_sp)
47       : m_collection_sp(collection_sp) {}
48
49   virtual ~Properties() {}
50
51   virtual lldb::OptionValuePropertiesSP GetValueProperties() const {
52     // This function is virtual in case subclasses want to lazily
53     // implement creating the properties.
54     return m_collection_sp;
55   }
56
57   virtual lldb::OptionValueSP GetPropertyValue(const ExecutionContext *exe_ctx,
58                                                llvm::StringRef property_path,
59                                                bool will_modify,
60                                                Error &error) const;
61
62   virtual Error SetPropertyValue(const ExecutionContext *exe_ctx,
63                                  VarSetOperationType op,
64     llvm::StringRef property_path, llvm::StringRef value);
65
66   virtual Error DumpPropertyValue(const ExecutionContext *exe_ctx, Stream &strm,
67     llvm::StringRef property_path,
68                                   uint32_t dump_mask);
69
70   virtual void DumpAllPropertyValues(const ExecutionContext *exe_ctx,
71                                      Stream &strm, uint32_t dump_mask);
72
73   virtual void DumpAllDescriptions(CommandInterpreter &interpreter,
74                                    Stream &strm) const;
75
76   size_t Apropos(llvm::StringRef keyword,
77                  std::vector<const Property *> &matching_properties) const;
78
79   lldb::OptionValuePropertiesSP GetSubProperty(const ExecutionContext *exe_ctx,
80                                                const ConstString &name);
81
82   // We sometimes need to introduce a setting to enable experimental features,
83   // but then we don't want the setting for these to cause errors when the
84   // setting
85   // goes away.  Add a sub-topic of the settings using this experimental name,
86   // and
87   // two things will happen.  One is that settings that don't find the name will
88   // not
89   // be treated as errors.  Also, if you decide to keep the settings just move
90   // them into
91   // the containing properties, and we will auto-forward the experimental
92   // settings to the
93   // real one.
94   static const char *GetExperimentalSettingsName();
95
96   static bool IsSettingExperimental(llvm::StringRef setting);
97
98 protected:
99   lldb::OptionValuePropertiesSP m_collection_sp;
100 };
101
102 } // namespace lldb_private
103
104 #endif // liblldb_UserSettingsController_h_