9#ifndef LLDB_INTERPRETER_OPTIONVALUEPROPERTIES_H
10#define LLDB_INTERPRETER_OPTIONVALUEPROPERTIES_H
23 :
public Cloneable<OptionValueProperties, OptionValue>,
24 public std::enable_shared_from_this<OptionValueProperties> {
34 void Clear()
override;
47 uint32_t dump_mask)
override;
54 Stream &strm, llvm::StringRef property_path,
55 uint32_t dump_mask,
bool is_json =
false);
60 void Apropos(llvm::StringRef keyword,
61 std::vector<const Property *> &matching_properties)
const;
89 llvm::StringRef property_path)
const;
95 llvm::StringRef key)
const;
102 llvm::StringRef path, llvm::StringRef value)
override;
136 llvm::StringRef name);
139 std::function<
void()> callback);
141 template <
typename T>
145 if (
OptionValue *value = property->GetValue().get())
146 return value->GetValueAs<T>();
148 if constexpr (std::is_pointer_v<T>)
151 return std::optional<T>{std::nullopt};
154 template <
typename T>
158 if (
OptionValue *value = property->GetValue().get()) {
159 value->SetValueAs(t);
168 assert(idx <
m_properties.size() &&
"invalid property index");
173 assert(idx <
m_properties.size() &&
"invalid property index");
static llvm::raw_ostream & error(Stream &strm)
A command line argument class.
A class that implements CRTP-based "virtual constructor" idiom.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void AppendProperty(llvm::StringRef name, llvm::StringRef desc, bool is_global, const lldb::OptionValueSP &value_sp)
llvm::StringMap< size_t > m_name_to_index
Status SetSubValue(const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef path, llvm::StringRef value) override
void Initialize(const PropertyDefinitions &setting_definitions)
OptionValueFileSpec * GetPropertyAtIndexAsOptionValueFileSpec(size_t idx, const ExecutionContext *exe_ctx=nullptr) const
auto GetPropertyAtIndexAs(size_t idx, const ExecutionContext *exe_ctx=nullptr) const
void Apropos(llvm::StringRef keyword, std::vector< const Property * > &matching_properties) const
lldb::OptionValueSP DeepCopy(const lldb::OptionValueSP &new_parent) const override
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
virtual void DumpAllDescriptions(CommandInterpreter &interpreter, Stream &strm) const
OptionValueFileSpecList * GetPropertyAtIndexAsOptionValueFileSpecList(size_t idx, const ExecutionContext *exe_ctx=nullptr) const
Property * ProtectedGetPropertyAtIndex(size_t idx)
OptionValueString * GetPropertyAtIndexAsOptionValueString(size_t idx, const ExecutionContext *exe_ctx=nullptr) const
bool SetPropertyAtIndex(size_t idx, T t, const ExecutionContext *exe_ctx=nullptr) const
virtual Status DumpPropertyValue(const ExecutionContext *exe_ctx, Stream &strm, llvm::StringRef property_path, uint32_t dump_mask, bool is_json=false)
llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) override
OptionValueDictionary * GetPropertyAtIndexAsOptionValueDictionary(size_t idx, const ExecutionContext *exe_ctx=nullptr) const
llvm::StringRef GetName() const override
static lldb::OptionValuePropertiesSP CreateLocalCopy(const Properties &global_properties)
lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx, llvm::StringRef name, Status &error) const override
std::vector< Property > m_properties
void SetValueChangedCallback(size_t property_idx, std::function< void()> callback)
const Property * ProtectedGetPropertyAtIndex(size_t idx) const
bool SetPropertyAtIndexFromArgs(size_t idx, const Args &args, const ExecutionContext *exe_ctx=nullptr)
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
virtual const Property * GetPropertyAtPath(const ExecutionContext *exe_ctx, llvm::StringRef property_path) const
virtual const Property * GetPropertyAtIndex(size_t idx, const ExecutionContext *exe_ctx=nullptr) const
virtual lldb::OptionValueSP GetValueForKey(const ExecutionContext *exe_ctx, llvm::StringRef key) const
lldb::OptionValuePropertiesSP GetSubProperty(const ExecutionContext *exe_ctx, llvm::StringRef name)
virtual lldb::OptionValueSP GetPropertyValueAtIndex(size_t idx, const ExecutionContext *exe_ctx) const
Type GetType() const override
OptionValueUInt64 * GetPropertyAtIndexAsOptionValueUInt64(size_t idx, const ExecutionContext *exe_ctx=nullptr) const
OptionValuePathMappings * GetPropertyAtIndexAsOptionValuePathMappings(size_t idx, const ExecutionContext *exe_ctx=nullptr) const
OptionValueSInt64 * GetPropertyAtIndexAsOptionValueSInt64(size_t idx, const ExecutionContext *exe_ctx=nullptr) const
virtual const Property * GetProperty(llvm::StringRef name, const ExecutionContext *exe_ctx=nullptr) const
bool GetPropertyAtIndexAsArgs(size_t idx, Args &args, const ExecutionContext *exe_ctx=nullptr) const
virtual size_t GetPropertyIndex(llvm::StringRef name) const
~OptionValueProperties() override=default
OptionValueProperties()=default
A stream class that can stream formatted output to a file.
A class that represents a running process on the host machine.
llvm::ArrayRef< PropertyDefinition > PropertyDefinitions
VarSetOperationType
Settable state variable types.
std::shared_ptr< lldb_private::OptionValueProperties > OptionValuePropertiesSP
std::shared_ptr< lldb_private::OptionValue > OptionValueSP