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