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 {
114 return m_impl_up->IsValid();
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);
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_private::ScriptObject & ref()
void Print(const char *str)
lldb_private::Stream & ref()
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.
lldb::SBError GetDescription(lldb::SBStream &stream) const
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
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.
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
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.
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