• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/lldb-private.h"
23 #include "lldb/Core/ConstString.h"
24 #include "lldb/Core/StringList.h"
25 #include "lldb/Core/Stream.h"
26 #include "lldb/Core/StreamString.h"
27 #include "lldb/Host/Mutex.h"
28 #include "lldb/Interpreter/OptionValue.h"
29 
30 namespace lldb_private {
31 
32 class Properties
33 {
34 public:
Properties()35     Properties () :
36         m_collection_sp ()
37     {
38     }
39 
Properties(const lldb::OptionValuePropertiesSP & collection_sp)40     Properties (const lldb::OptionValuePropertiesSP &collection_sp) :
41         m_collection_sp (collection_sp)
42     {
43     }
44 
45     virtual
~Properties()46     ~Properties()
47     {
48     }
49 
50     virtual lldb::OptionValuePropertiesSP
GetValueProperties()51     GetValueProperties () const
52     {
53         // This function is virtual in case subclasses want to lazily
54         // implement creating the properties.
55         return m_collection_sp;
56     }
57 
58     virtual lldb::OptionValueSP
59     GetPropertyValue (const ExecutionContext *exe_ctx,
60                       const char *property_path,
61                       bool will_modify,
62                       Error &error) const;
63 
64     virtual Error
65     SetPropertyValue (const ExecutionContext *exe_ctx,
66                       VarSetOperationType op,
67                       const char *property_path,
68                       const char *value);
69 
70     virtual Error
71     DumpPropertyValue (const ExecutionContext *exe_ctx,
72                        Stream &strm,
73                        const char *property_path,
74                        uint32_t dump_mask);
75 
76     virtual void
77     DumpAllPropertyValues (const ExecutionContext *exe_ctx,
78                            Stream &strm,
79                            uint32_t dump_mask);
80 
81     virtual void
82     DumpAllDescriptions (CommandInterpreter &interpreter,
83                          Stream &strm) const;
84 
85     size_t
86     Apropos (const char *keyword,
87              std::vector<const Property *> &matching_properties) const;
88 
89     lldb::OptionValuePropertiesSP
90     GetSubProperty (const ExecutionContext *exe_ctx,
91                     const ConstString &name);
92 protected:
93     lldb::OptionValuePropertiesSP m_collection_sp;
94 };
95 
96 } // namespace lldb_private
97 
98 #endif // liblldb_UserSettingsController_h_
99