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_
19 // Other libraries and framework includes
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"
29 namespace lldb_private {
33 Properties() : m_collection_sp() {}
35 Properties(const lldb::OptionValuePropertiesSP &collection_sp)
36 : m_collection_sp(collection_sp) {}
38 virtual ~Properties() {}
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;
46 virtual lldb::OptionValueSP GetPropertyValue(const ExecutionContext *exe_ctx,
47 llvm::StringRef property_path,
51 virtual Error SetPropertyValue(const ExecutionContext *exe_ctx,
52 VarSetOperationType op,
53 llvm::StringRef property_path, llvm::StringRef value);
55 virtual Error DumpPropertyValue(const ExecutionContext *exe_ctx, Stream &strm,
56 llvm::StringRef property_path,
59 virtual void DumpAllPropertyValues(const ExecutionContext *exe_ctx,
60 Stream &strm, uint32_t dump_mask);
62 virtual void DumpAllDescriptions(CommandInterpreter &interpreter,
65 size_t Apropos(llvm::StringRef keyword,
66 std::vector<const Property *> &matching_properties) const;
68 lldb::OptionValuePropertiesSP GetSubProperty(const ExecutionContext *exe_ctx,
69 const ConstString &name);
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
74 // goes away. Add a sub-topic of the settings using this experimental name,
76 // two things will happen. One is that settings that don't find the name will
78 // be treated as errors. Also, if you decide to keep the settings just move
80 // the containing properties, and we will auto-forward the experimental
83 static const char *GetExperimentalSettingsName();
85 static bool IsSettingExperimental(llvm::StringRef setting);
88 lldb::OptionValuePropertiesSP m_collection_sp;
91 } // namespace lldb_private
93 #endif // liblldb_UserSettingsController_h_