30#pragma mark SBStructuredData
56 if (impl_up && impl_up->IsValid())
94 if (!json_obj || llvm::is_contained(unsupported_type, json_obj->GetType()))
108 return this->
operator bool();
111SBStructuredData::operator
bool()
const {
171 llvm::StringRef key =
object->GetStringValue(
"");
194uint64_t SBStructuredData::GetIntegerValue(uint64_t fail_value)
const {
203 return m_impl_up->GetIntegerValue(fail_value);
209 return m_impl_up->GetIntegerValue(fail_value);
215 return m_impl_up->GetFloatValue(fail_value);
221 return m_impl_up->GetBooleanValue(fail_value);
227 return m_impl_up->GetStringValue(dst, dst_len);
247 m_impl_up->SetUnsignedIntegerValue(value);
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_INSTRUMENT_VA(...)
lldb::DebuggerSP m_opaque_sp
void SetError(uint32_t err, lldb::ErrorType type)
lldb::ScriptLanguage GetLanguage() const
lldb::ScriptObjectPtr GetPointer() const
lldb_private::ScriptObject & ref()
void Print(const char *str)
lldb_private::Stream & ref()
void SetStringValue(const char *value)
Change the type to string and overwrite the previous data with the new value.
lldb::SBStructuredData GetItemAtIndex(size_t idx) const
Return the value corresponding to an index if this data structure is array.
lldb::SBStructuredData & operator=(const lldb::SBStructuredData &rhs)
int64_t GetSignedIntegerValue(int64_t fail_value=0) const
Return the integer value if this data structure is an integer type.
void SetGenericValue(SBScriptObject value)
Change the type to generic and overwrite the previous data with the new value.
lldb::SBError GetDescription(lldb::SBStream &stream) const
void SetBooleanValue(bool value)
Change the type to boolean and overwrite the previous data with the new value.
size_t GetStringValue(char *dst, size_t dst_len) const
Provides the string value if this data structure is a string type.
lldb::SBScriptObject GetGenericValue() const
Return the generic pointer if this data structure is a generic type.
bool GetBooleanValue(bool fail_value=false) const
Return the boolean value if this data structure is a boolean type.
StructuredDataImplUP m_impl_up
void SetUnsignedIntegerValue(uint64_t value)
Change the type to unsigned interger and overwrite the previous data with the new value.
lldb::StructuredDataType GetType() const
Return the type of data in this data structure.
uint64_t GetUnsignedIntegerValue(uint64_t fail_value=0) const
Return the integer value if this data structure is an integer type.
void SetSignedIntegerValue(int64_t value)
Change the type to signed interger and overwrite the previous data with the new value.
size_t GetSize() const
Return the size (i.e.
bool GetKeys(lldb::SBStringList &keys) const
Fill keys with the keys in this object and return true if this data structure is a dictionary.
lldb::SBError GetAsJSON(lldb::SBStream &stream) const
void SetFloatValue(double value)
Change the type to float and overwrite the previous data with the new value.
lldb::SBStructuredData GetValueForKey(const char *key) const
Return the value corresponding to a key if this data structure is a dictionary type.
lldb::SBError SetFromJSON(lldb::SBStream &stream)
double GetFloatValue(double fail_value=0.0) const
Return the floating point value if this data structure is a floating type.
void SetValueForKey(const char *key, SBStructuredData &value)
Set the value corresponding to a key.
virtual StructuredData::ObjectSP CreateStructuredDataFromScriptObject(ScriptObject obj)
static Status FromErrorString(const char *str)
void AppendString(const std::string &s)
bool ForEach(std::function< bool(Object *object)> const &foreach_callback) const
Dictionary * GetAsDictionary()
std::shared_ptr< Object > ObjectSP
static ObjectSP ParseJSON(llvm::StringRef json_text)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Event > EventSP
std::unique_ptr< lldb_private::StructuredDataImpl > StructuredDataImplUP
@ eStructuredDataTypeDictionary
@ eStructuredDataTypeInvalid
@ eStructuredDataTypeGeneric