1 //====-- UserSettingsController.h --------------------------------*- C++-*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_UserSettingsController_h_
11 #define liblldb_UserSettingsController_h_
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
17 #include "llvm/ADT/StringRef.h" // for StringRef
21 #include <stddef.h> // for size_t
22 #include <stdint.h> // for uint32_t
24 namespace lldb_private {
25 class CommandInterpreter;
27 namespace lldb_private {
30 namespace lldb_private {
31 class ExecutionContext;
33 namespace lldb_private {
36 namespace lldb_private {
40 namespace lldb_private {
44 Properties() : m_collection_sp() {}
46 Properties(const lldb::OptionValuePropertiesSP &collection_sp)
47 : m_collection_sp(collection_sp) {}
49 virtual ~Properties() {}
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;
57 virtual lldb::OptionValueSP GetPropertyValue(const ExecutionContext *exe_ctx,
58 llvm::StringRef property_path,
62 virtual Error SetPropertyValue(const ExecutionContext *exe_ctx,
63 VarSetOperationType op,
64 llvm::StringRef property_path, llvm::StringRef value);
66 virtual Error DumpPropertyValue(const ExecutionContext *exe_ctx, Stream &strm,
67 llvm::StringRef property_path,
70 virtual void DumpAllPropertyValues(const ExecutionContext *exe_ctx,
71 Stream &strm, uint32_t dump_mask);
73 virtual void DumpAllDescriptions(CommandInterpreter &interpreter,
76 size_t Apropos(llvm::StringRef keyword,
77 std::vector<const Property *> &matching_properties) const;
79 lldb::OptionValuePropertiesSP GetSubProperty(const ExecutionContext *exe_ctx,
80 const ConstString &name);
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
85 // goes away. Add a sub-topic of the settings using this experimental name,
87 // two things will happen. One is that settings that don't find the name will
89 // be treated as errors. Also, if you decide to keep the settings just move
91 // the containing properties, and we will auto-forward the experimental
94 static const char *GetExperimentalSettingsName();
96 static bool IsSettingExperimental(llvm::StringRef setting);
99 lldb::OptionValuePropertiesSP m_collection_sp;
102 } // namespace lldb_private
104 #endif // liblldb_UserSettingsController_h_