1 //====-- UserSettingsController.cpp ------------------------------*- 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 #include "lldb/lldb-python.h"
15 #include "lldb/Core/UserSettingsController.h"
16 #include "lldb/Core/Error.h"
17 #include "lldb/Core/RegularExpression.h"
18 #include "lldb/Core/Stream.h"
19 #include "lldb/Core/StreamString.h"
20 #include "lldb/Interpreter/CommandInterpreter.h"
21 #include "lldb/Interpreter/OptionValueString.h"
24 using namespace lldb_private;
28 Properties::GetPropertyValue (const ExecutionContext *exe_ctx,
33 OptionValuePropertiesSP properties_sp (GetValueProperties ());
35 return properties_sp->GetSubValue(exe_ctx, path, will_modify, error);
36 return lldb::OptionValueSP();
40 Properties::SetPropertyValue (const ExecutionContext *exe_ctx,
41 VarSetOperationType op,
45 OptionValuePropertiesSP properties_sp (GetValueProperties ());
47 return properties_sp->SetSubValue(exe_ctx, op, path, value);
49 error.SetErrorString ("no properties");
54 Properties::DumpAllPropertyValues (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
56 OptionValuePropertiesSP properties_sp (GetValueProperties ());
58 return properties_sp->DumpValue (exe_ctx, strm, dump_mask);
62 Properties::DumpAllDescriptions (CommandInterpreter &interpreter,
65 strm.PutCString("Top level variables:\n\n");
67 OptionValuePropertiesSP properties_sp (GetValueProperties ());
69 return properties_sp->DumpAllDescriptions (interpreter, strm);
75 Properties::DumpPropertyValue (const ExecutionContext *exe_ctx, Stream &strm, const char *property_path, uint32_t dump_mask)
77 OptionValuePropertiesSP properties_sp (GetValueProperties ());
80 return properties_sp->DumpPropertyValue (exe_ctx,
86 error.SetErrorString("empty property list");
91 Properties::Apropos (const char *keyword, std::vector<const Property *> &matching_properties) const
93 OptionValuePropertiesSP properties_sp (GetValueProperties ());
96 properties_sp->Apropos (keyword, matching_properties);
98 return matching_properties.size();
102 lldb::OptionValuePropertiesSP
103 Properties::GetSubProperty (const ExecutionContext *exe_ctx,
104 const ConstString &name)
106 OptionValuePropertiesSP properties_sp (GetValueProperties ());
108 return properties_sp->GetSubProperty (exe_ctx, name);
109 return lldb::OptionValuePropertiesSP();