Lines Matching +full:bool +full:- +full:property

1 //===-- OptionValueProperties.cpp -----------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
15 #include "lldb/Interpreter/Property.h"
28 Property property(definition); in Initialize() local
29 assert(property.IsValid()); in Initialize()
30 m_name_to_index.insert({property.GetName(), m_properties.size()}); in Initialize()
31 property.GetValue()->SetParent(shared_from_this()); in Initialize()
32 m_properties.push_back(property); in Initialize()
38 Property *property = ProtectedGetPropertyAtIndex(property_idx); in SetValueChangedCallback() local
39 if (property) in SetValueChangedCallback()
40 property->SetValueChangedCallback(std::move(callback)); in SetValueChangedCallback()
44 llvm::StringRef desc, bool is_global, in AppendProperty()
46 Property property(name, desc, is_global, value_sp); in AppendProperty() local
48 m_properties.push_back(property); in AppendProperty()
49 value_sp->SetParent(shared_from_this()); in AppendProperty()
58 const size_t idx = iter->second; in GetValueForKey()
61 return GetPropertyAtIndex(idx, exe_ctx)->GetValue(); in GetValueForKey()
88 value_sp->GetSubValue(exe_ctx, sub_name.drop_front(), error); in GetSubValue()
94 return_val_sp = value_sp->GetSubValue( in GetSubValue()
104 // Array or dictionary access for subvalues like: "[12]" -- access in GetSubValue()
105 // 12th array element "['hello']" -- dictionary access of key named hello in GetSubValue()
106 return value_sp->GetSubValue(exe_ctx, sub_name, error); in GetSubValue()
122 bool name_contains_experimental = false; in SetSubValue()
129 error = value_sp->SetValueFromString(value, op); in SetSubValue()
131 // Don't set an error if the path contained .experimental. - those are in SetSubValue()
145 return iter->second; in GetPropertyIndex()
148 const Property *
154 return GetPropertyAtIndex(iter->second, exe_ctx); in GetProperty()
159 const Property *setting = GetPropertyAtIndex(idx, exe_ctx); in GetPropertyValueAtIndex()
161 return setting->GetValue(); in GetPropertyValueAtIndex()
170 return value_sp->GetAsPathMappings(); in GetPropertyAtIndexAsOptionValuePathMappings()
179 return value_sp->GetAsFileSpecList(); in GetPropertyAtIndexAsOptionValueFileSpecList()
183 bool OptionValueProperties::GetPropertyAtIndexAsArgs( in GetPropertyAtIndexAsArgs()
185 const Property *property = GetPropertyAtIndex(idx, exe_ctx); in GetPropertyAtIndexAsArgs() local
186 if (!property) in GetPropertyAtIndexAsArgs()
189 OptionValue *value = property->GetValue().get(); in GetPropertyAtIndexAsArgs()
193 const OptionValueArgs *arguments = value->GetAsArgs(); in GetPropertyAtIndexAsArgs()
195 arguments->GetArgs(args); in GetPropertyAtIndexAsArgs()
199 const OptionValueArray *array = value->GetAsArray(); in GetPropertyAtIndexAsArgs()
201 array->GetArgs(args); in GetPropertyAtIndexAsArgs()
205 const OptionValueDictionary *dict = value->GetAsDictionary(); in GetPropertyAtIndexAsArgs()
207 dict->GetArgs(args); in GetPropertyAtIndexAsArgs()
214 bool OptionValueProperties::SetPropertyAtIndexFromArgs( in SetPropertyAtIndexFromArgs()
216 const Property *property = GetPropertyAtIndex(idx, exe_ctx); in SetPropertyAtIndexFromArgs() local
217 if (!property) in SetPropertyAtIndexFromArgs()
220 OptionValue *value = property->GetValue().get(); in SetPropertyAtIndexFromArgs()
224 OptionValueArgs *arguments = value->GetAsArgs(); in SetPropertyAtIndexFromArgs()
226 return arguments->SetArgs(args, eVarSetOperationAssign).Success(); in SetPropertyAtIndexFromArgs()
228 OptionValueArray *array = value->GetAsArray(); in SetPropertyAtIndexFromArgs()
230 return array->SetArgs(args, eVarSetOperationAssign).Success(); in SetPropertyAtIndexFromArgs()
232 OptionValueDictionary *dict = value->GetAsDictionary(); in SetPropertyAtIndexFromArgs()
234 return dict->SetArgs(args, eVarSetOperationAssign).Success(); in SetPropertyAtIndexFromArgs()
242 const Property *property = GetPropertyAtIndex(idx, exe_ctx); in GetPropertyAtIndexAsOptionValueDictionary() local
243 if (property) in GetPropertyAtIndexAsOptionValueDictionary()
244 return property->GetValue()->GetAsDictionary(); in GetPropertyAtIndexAsOptionValueDictionary()
251 const Property *property = GetPropertyAtIndex(idx, exe_ctx); in GetPropertyAtIndexAsOptionValueFileSpec() local
252 if (property) { in GetPropertyAtIndexAsOptionValueFileSpec()
253 OptionValue *value = property->GetValue().get(); in GetPropertyAtIndexAsOptionValueFileSpec()
255 return value->GetAsFileSpec(); in GetPropertyAtIndexAsOptionValueFileSpec()
262 const Property *property = GetPropertyAtIndex(idx, exe_ctx); in GetPropertyAtIndexAsOptionValueSInt64() local
263 if (property) { in GetPropertyAtIndexAsOptionValueSInt64()
264 OptionValue *value = property->GetValue().get(); in GetPropertyAtIndexAsOptionValueSInt64()
266 return value->GetAsSInt64(); in GetPropertyAtIndexAsOptionValueSInt64()
273 const Property *property = GetPropertyAtIndex(idx, exe_ctx); in GetPropertyAtIndexAsOptionValueUInt64() local
274 if (property) { in GetPropertyAtIndexAsOptionValueUInt64()
275 OptionValue *value = property->GetValue().get(); in GetPropertyAtIndexAsOptionValueUInt64()
277 return value->GetAsUInt64(); in GetPropertyAtIndexAsOptionValueUInt64()
286 return value_sp->GetAsString(); in GetPropertyAtIndexAsOptionValueString()
293 m_properties[i].GetValue()->Clear(); in Clear()
325 const Property *property = GetPropertyAtIndex(i, exe_ctx); in DumpValue() local
326 if (property) { in DumpValue()
327 OptionValue *option_value = property->GetValue().get(); in DumpValue()
329 const bool transparent_value = option_value->ValueIsTransparent(); in DumpValue()
330 property->Dump(exe_ctx, strm, dump_mask); in DumpValue()
342 const Property *property = GetPropertyAtIndex(i, exe_ctx); in ToJSON() local
343 if (property) { in ToJSON()
344 OptionValue *option_value = property->GetValue().get(); in ToJSON()
346 json_properties.try_emplace(property->GetName(), in ToJSON()
347 option_value->ToJSON(exe_ctx)); in ToJSON()
357 bool is_json) { in DumpPropertyValue()
361 if (!value_sp->ValueIsTransparent()) { in DumpPropertyValue()
370 llvm::formatv("{0:2}", value_sp->ToJSON(exe_ctx)).str().c_str()); in DumpPropertyValue()
372 value_sp->DumpValue(exe_ctx, strm, dump_mask); in DumpPropertyValue()
382 auto copy_sp = global_props_sp->DeepCopy(global_props_sp->GetParent()); in CreateLocalCopy()
389 // copy_sp->GetAsProperties cannot be used here as it doesn't work for derived in DeepCopy()
394 for (auto &property : props_value_ptr->m_properties) { in DeepCopy() local
397 if (!property.IsGlobal()) { in DeepCopy()
398 auto value_sp = property.GetValue()->DeepCopy(copy_sp); in DeepCopy()
399 property.SetOptionValue(value_sp); in DeepCopy()
405 const Property *
411 const Property *property = nullptr; in GetPropertyAtPath() local
422 property = GetProperty(key, exe_ctx); in GetPropertyAtPath()
423 if (sub_name.empty() || !property) in GetPropertyAtPath()
424 return property; in GetPropertyAtPath()
428 property->GetValue()->GetAsProperties(); in GetPropertyAtPath()
430 return sub_properties->GetPropertyAtPath(exe_ctx, sub_name.drop_front()); in GetPropertyAtPath()
440 const Property *property = ProtectedGetPropertyAtIndex(i); in DumpAllDescriptions() local
441 if (property) in DumpAllDescriptions()
442 max_name_len = std::max<size_t>(property->GetName().size(), max_name_len); in DumpAllDescriptions()
445 const Property *property = ProtectedGetPropertyAtIndex(i); in DumpAllDescriptions() local
446 if (property) in DumpAllDescriptions()
447 property->DumpDescription(interpreter, strm, max_name_len, false); in DumpAllDescriptions()
453 std::vector<const Property *> &matching_properties) const { in Apropos()
457 const Property *property = ProtectedGetPropertyAtIndex(i); in Apropos() local
458 if (property) { in Apropos()
460 property->GetValue()->GetAsProperties(); in Apropos()
462 properties->Apropos(keyword, matching_properties); in Apropos()
464 bool match = false; in Apropos()
465 llvm::StringRef name = property->GetName(); in Apropos()
469 llvm::StringRef desc = property->GetDescription(); in Apropos()
474 matching_properties.push_back(property); in Apropos()
486 OptionValueProperties *ov_properties = option_value_sp->GetAsProperties(); in GetSubProperty()
488 return ov_properties->shared_from_this(); in GetSubProperty()