9#ifndef LLDB_CORE_STRUCTUREDDATAIMPL_H
10#define LLDB_CORE_STRUCTUREDDATAIMPL_H
19#include "llvm/ADT/StringRef.h"
22#pragma mark StructuredDataImpl
77 return plugin_sp->GetDescription(
m_data_sp, stream);
95 return (dict->GetSize());
98 return (array->GetSize());
105 auto dict =
m_data_sp->GetAsDictionary();
107 return dict->GetValueForKey(llvm::StringRef(key));
116 return array->GetItemAtIndex(idx);
143 llvm::StringRef result =
m_data_sp->GetStringValue();
147 if (!dst || !dst_len) {
149 return (::snprintf(s, 1,
"%s", result.data()));
151 return (::snprintf(dst, dst_len,
"%s", result.data()));
This class handles one or more StructuredData::Dictionary entries that are raised for structured data...
static Status FromErrorString(const char *str)
A stream class that can stream formatted output to a file.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
StructuredDataImpl(StructuredData::ObjectSP obj)
double GetFloatValue(double fail_value=0.0) const
Status GetAsJSON(Stream &stream) const
StructuredData::ObjectSP GetItemAtIndex(size_t idx) const
int64_t GetIntegerValue(int64_t fail_value=0) const
uint64_t GetIntegerValue(uint64_t fail_value=0) const
lldb::StructuredDataType GetType() const
~StructuredDataImpl()=default
StructuredDataImpl(const lldb::EventSP &event_sp)
StructuredData::ObjectSP m_data_sp
StructuredDataImpl & operator=(const StructuredDataImpl &rhs)=default
StructuredData::ObjectSP GetValueForKey(const char *key) const
size_t GetStringValue(char *dst, size_t dst_len) const
StructuredData::ObjectSP GetObjectSP() const
void SetObjectSP(const StructuredData::ObjectSP &obj)
void * GetGenericValue() const
StructuredData::ObjectSP GetObjectSP()
StructuredDataImpl()=default
bool GetBooleanValue(bool fail_value=false) const
lldb::StructuredDataPluginWP m_plugin_wp
Status GetDescription(Stream &stream) const
StructuredDataImpl(const StructuredDataImpl &rhs)=default
std::shared_ptr< Object > ObjectSP
A class that represents a running process on the host machine.
std::weak_ptr< lldb_private::StructuredDataPlugin > StructuredDataPluginWP
std::shared_ptr< lldb_private::StructuredDataPlugin > StructuredDataPluginSP
std::shared_ptr< lldb_private::Event > EventSP
@ eStructuredDataTypeDictionary
@ eStructuredDataTypeInvalid
@ eStructuredDataTypeArray