9#ifndef LLDB_INTERPRETER_OPTIONVALUE_H
10#define LLDB_INTERPRETER_OPTIONVALUE_H
25#include "llvm/Support/JSON.h"
94 uint32_t dump_mask) = 0;
120 llvm::StringRef name,
122 error.SetErrorStringWithFormatv(
"'{0}' is not a valid subvalue", name);
128 llvm::StringRef value);
132 virtual llvm::StringRef
GetName()
const {
return llvm::StringRef(); }
272 template <
typename T, std::enable_if_t<!std::is_po
inter_v<T>,
bool> = true>
274 if constexpr (std::is_same_v<T, uint64_t>)
276 if constexpr (std::is_same_v<T, int64_t>)
278 if constexpr (std::is_same_v<T, bool>)
280 if constexpr (std::is_same_v<T, char>)
282 if constexpr (std::is_same_v<T, lldb::Format>)
284 if constexpr (std::is_same_v<T, FileSpec>)
286 if constexpr (std::is_same_v<T, FileSpecList>)
288 if constexpr (std::is_same_v<T, lldb::LanguageType>)
290 if constexpr (std::is_same_v<T, llvm::StringRef>)
292 if constexpr (std::is_same_v<T, ArchSpec>)
294 if constexpr (std::is_enum_v<T>)
296 return static_cast<T
>(*value);
300 template <
typename T,
301 typename U =
typename std::remove_const<
302 typename std::remove_pointer<T>::type>::type,
303 std::enable_if_t<std::is_pointer_v<T>,
bool> =
true>
305 if constexpr (std::is_same_v<U, FormatEntity::Entry>)
307 if constexpr (std::is_same_v<U, RegularExpression>)
332 template <
typename T, std::enable_if_t<std::is_enum_v<T>,
bool> = true>
static llvm::raw_ostream & error(Stream &strm)
An architecture specification class.
"lldb/Utility/ArgCompletionRequest.h"
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
virtual bool DumpQualifiedName(Stream &strm) const
std::optional< char > GetCharValue() const
std::optional< FileSpecList > GetFileSpecListValue() const
bool SetArchSpecValue(ArchSpec arch_spec)
virtual ~OptionValue()=default
void SetValueChangedCallback(std::function< void()> callback)
std::optional< ArchSpec > GetArchSpecValue() const
OptionValueDictionary * GetAsDictionary()
virtual lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx, llvm::StringRef name, Status &error) const
virtual Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign)
OptionValueSInt64 * GetAsSInt64()
std::optional< FileSpec > GetFileSpecValue() const
static lldb::OptionValueSP CreateValueFromCStringForTypeMask(const char *value_cstr, uint32_t type_mask, Status &error)
std::optional< uint64_t > GetUInt64Value() const
virtual llvm::json::Value ToJSON(const ExecutionContext *exe_ctx)
bool SetFileSpecValue(FileSpec file_spec)
virtual void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)=0
virtual lldb::OptionValueSP Clone() const =0
virtual Type GetType() const =0
lldb::OptionValueWP m_parent_wp
OptionValueFileSpecList * GetAsFileSpecList()
virtual bool ValueIsTransparent() const
OptionValueRegex * GetAsRegex()
virtual bool IsAggregateValue() const
void SetParent(const lldb::OptionValueSP &parent_sp)
OptionValueUInt64 * GetAsUInt64()
OptionValue & operator=(const OptionValue &other)
OptionValueFormatEntity * GetAsFormatEntity()
bool SetValueAs(lldb::Format v)
bool SetCharValue(char new_value)
OptionValuePathMappings * GetAsPathMappings()
virtual void AutoComplete(CommandInterpreter &interpreter, CompletionRequest &request)
OptionValueProperties * GetAsProperties()
static OptionValue::Type ConvertTypeMaskToType(uint32_t type_mask)
OptionValueEnumeration * GetAsEnumeration()
virtual lldb::OptionValueSP DeepCopy(const lldb::OptionValueSP &new_parent) const
static const char * GetBuiltinTypeAsCString(Type t)
bool SetValueAs(lldb::LanguageType v)
OptionValueFormat * GetAsFormat()
bool SetValueAs(uint64_t v)
lldb::OptionValueSP GetParent() const
void NotifyValueChanged()
OptionValueArgs * GetAsArgs()
virtual const char * GetTypeAsCString() const
OptionValueChar * GetAsChar()
bool AppendFileSpecValue(FileSpec file_spec)
OptionValueArray * GetAsArray()
std::optional< lldb::LanguageType > GetLanguageValue() const
bool SetStringValue(llvm::StringRef new_value)
std::optional< int64_t > GetSInt64Value() const
bool SetUUIDValue(const UUID &uuid)
bool OptionWasSet() const
std::optional< lldb::Format > GetFormatValue() const
std::optional< int64_t > GetEnumerationValue() const
std::optional< bool > GetBooleanValue() const
bool SetValueAs(llvm::StringRef v)
bool SetBooleanValue(bool new_value)
std::optional< llvm::StringRef > GetStringValue() const
OptionValueBoolean * GetAsBoolean()
OptionValueFileSpec * GetAsFileSpec()
const RegularExpression * GetRegexValue() const
const FormatEntity::Entry * GetFormatEntity() const
bool SetEnumerationValue(int64_t value)
OptionValueUUID * GetAsUUID()
std::optional< T > GetValueAs() const
bool SetUInt64Value(uint64_t new_value)
virtual llvm::StringRef GetName() const
OptionValueArch * GetAsArch()
bool SetValueAs(int64_t v)
bool SetValueAs(ArchSpec v)
bool SetFormatValue(lldb::Format new_value)
bool SetLanguageValue(lldb::LanguageType new_language)
static uint32_t ConvertTypeToMask(OptionValue::Type type)
std::function< void()> m_callback
OptionValueLanguage * GetAsLanguage()
std::optional< UUID > GetUUIDValue() const
bool SetValueAs(FileSpec v)
bool SetSInt64Value(int64_t new_value)
virtual Status SetSubValue(const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef name, llvm::StringRef value)
OptionValueString * GetAsString()
A stream class that can stream formatted output to a file.
A class that represents a running process on the host machine.
VarSetOperationType
Settable state variable types.
Format
Display format definitions.
LanguageType
Programming language type.
std::weak_ptr< lldb_private::OptionValue > OptionValueWP
std::shared_ptr< lldb_private::OptionValue > OptionValueSP