LLDB mainline
Public Member Functions | Protected Types | Protected Attributes | List of all members
lldb_private::StructuredData::Array Class Reference

#include <StructuredData.h>

Inheritance diagram for lldb_private::StructuredData::Array:
Inheritance graph
[legend]

Public Member Functions

 Array ()
 
 ~Array () override=default
 
bool ForEach (std::function< bool(Object *object)> const &foreach_callback) const
 
size_t GetSize () const
 
ObjectSP operator[] (size_t idx)
 
ObjectSP GetItemAtIndex (size_t idx) const
 
template<class IntType >
std::optional< IntType > GetItemAtIndexAsInteger (size_t idx) const
 
std::optional< llvm::StringRef > GetItemAtIndexAsString (size_t idx) const
 
std::optional< Dictionary * > GetItemAtIndexAsDictionary (size_t idx) const
 Retrieves the element at index idx from a StructuredData::Array if it is a Dictionary.
 
void Push (const ObjectSP &item)
 
void AddItem (const ObjectSP &item)
 
template<typename T >
void AddIntegerItem (T value)
 
void AddFloatItem (double value)
 
void AddStringItem (llvm::StringRef value)
 
void AddBooleanItem (bool value)
 
void Serialize (llvm::json::OStream &s) const override
 
void GetDescription (lldb_private::Stream &s) const override
 
- Public Member Functions inherited from lldb_private::StructuredData::Object
 Object (lldb::StructuredDataType t=lldb::eStructuredDataTypeInvalid)
 
virtual ~Object ()=default
 
virtual bool IsValid () const
 
virtual void Clear ()
 
lldb::StructuredDataType GetType () const
 
void SetType (lldb::StructuredDataType t)
 
ArrayGetAsArray ()
 
DictionaryGetAsDictionary ()
 
UnsignedIntegerGetAsUnsignedInteger ()
 
SignedIntegerGetAsSignedInteger ()
 
uint64_t GetUnsignedIntegerValue (uint64_t fail_value=0)
 
int64_t GetSignedIntegerValue (int64_t fail_value=0)
 
FloatGetAsFloat ()
 
double GetFloatValue (double fail_value=0.0)
 
BooleanGetAsBoolean ()
 
bool GetBooleanValue (bool fail_value=false)
 
StringGetAsString ()
 
llvm::StringRef GetStringValue (const char *fail_value=nullptr)
 
GenericGetAsGeneric ()
 
ObjectSP GetObjectForDotSeparatedPath (llvm::StringRef path)
 
void DumpToStdout (bool pretty_print=true) const
 
virtual void Serialize (llvm::json::OStream &s) const =0
 
void Dump (lldb_private::Stream &s, bool pretty_print=true) const
 
virtual void GetDescription (lldb_private::Stream &s) const
 

Protected Types

typedef std::vector< ObjectSPcollection
 

Protected Attributes

collection m_items
 

Detailed Description

Definition at line 193 of file StructuredData.h.

Member Typedef Documentation

◆ collection

Definition at line 294 of file StructuredData.h.

Constructor & Destructor Documentation

◆ Array()

lldb_private::StructuredData::Array::Array ( )
inline

Definition at line 195 of file StructuredData.h.

◆ ~Array()

lldb_private::StructuredData::Array::~Array ( )
overridedefault

Member Function Documentation

◆ AddBooleanItem()

void lldb_private::StructuredData::Array::AddBooleanItem ( bool  value)
inline

Definition at line 285 of file StructuredData.h.

References AddItem().

◆ AddFloatItem()

void lldb_private::StructuredData::Array::AddFloatItem ( double  value)
inline

Definition at line 279 of file StructuredData.h.

References AddItem().

◆ AddIntegerItem()

template<typename T >
void lldb_private::StructuredData::Array::AddIntegerItem ( value)
inline

◆ AddItem()

void lldb_private::StructuredData::Array::AddItem ( const ObjectSP item)
inline

◆ AddStringItem()

void lldb_private::StructuredData::Array::AddStringItem ( llvm::StringRef  value)
inline

Definition at line 281 of file StructuredData.h.

References AddItem().

◆ ForEach()

bool lldb_private::StructuredData::Array::ForEach ( std::function< bool(Object *object)> const &  foreach_callback) const
inline

◆ GetDescription()

void StructuredData::Array::GetDescription ( lldb_private::Stream s) const
overridevirtual

◆ GetItemAtIndex()

ObjectSP lldb_private::StructuredData::Array::GetItemAtIndex ( size_t  idx) const
inline

◆ GetItemAtIndexAsDictionary()

std::optional< Dictionary * > lldb_private::StructuredData::Array::GetItemAtIndexAsDictionary ( size_t  idx) const
inline

Retrieves the element at index idx from a StructuredData::Array if it is a Dictionary.

Parameters
[in]idxThe index of the element to retrieve.
Returns
If the element at index idx is a Dictionary, this method returns a valid pointer to the Dictionary wrapped in a std::optional. If the element is not a Dictionary or the index is invalid, this returns std::nullopt. Note that the underlying Dictionary pointer is never nullptr.

Definition at line 257 of file StructuredData.h.

References GetItemAtIndex().

Referenced by ObjectFileMachO::GetCorefileThreadExtraInfos(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::QueryGDBServer(), and lldb_private::DynamicRegisterInfo::SetRegisterInfo().

◆ GetItemAtIndexAsInteger()

template<class IntType >
std::optional< IntType > lldb_private::StructuredData::Array::GetItemAtIndexAsInteger ( size_t  idx) const
inline

◆ GetItemAtIndexAsString()

std::optional< llvm::StringRef > lldb_private::StructuredData::Array::GetItemAtIndexAsString ( size_t  idx) const
inline

◆ GetSize()

size_t lldb_private::StructuredData::Array::GetSize ( ) const
inline

Definition at line 208 of file StructuredData.h.

References m_items.

Referenced by lldb_private::DynamicRegisterInfo::ByteOffsetFromComposite(), lldb_private::Target::CreateBreakpointsFromFile(), lldb_private::SearchFilterByModule::CreateFromStructuredData(), lldb_private::SearchFilterByModuleList::CreateFromStructuredData(), lldb_private::SearchFilterByModuleListAndCU::CreateFromStructuredData(), lldb_private::BreakpointResolverName::CreateFromStructuredData(), lldb_private::BreakpointOptions::CommandData::CreateFromStructuredData(), lldb_private::BreakpointResolverFileRegex::CreateFromStructuredData(), lldb_private::Breakpoint::CreateFromStructuredData(), lldb_private::PlatformDarwin::ExtractAppSpecificInfo(), ObjectFileMachO::GetCorefileThreadExtraInfos(), lldb_private::Thread::GetDescription(), SystemRuntimeMacOSX::GetExtendedBacktraceThread(), lldb_private::InstrumentationRuntimeTSan::GetFirstNonInternalFramePc(), GetItemAtIndex(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetModulesInfo(), lldb_private::process_gdb_remote::ProcessGDBRemote::GetThreadStopInfoFromJSON(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_jModulesInfo(), CommandObjectBreakpointRead::CommandOptions::HandleOptionArgumentCompletion(), lldb_private::DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(), lldb_private::Process::MapSupportedStructuredDataPlugins(), CommandObjectScriptingObjectParsed::CommandOptions::ParseUsageMaskFromArray(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::QueryGDBServer(), lldb_private::DebuggerStats::ReportStatistics(), lldb_private::Breakpoint::SerializedBreakpointMatchesNames(), CommandObjectScriptingObjectParsed::CommandOptions::SetOptionsFromArray(), lldb_private::DynamicRegisterInfo::SetRegisterInfo(), lldb_private::process_gdb_remote::ProcessGDBRemote::UpdateThreadIDList(), and lldb_private::process_gdb_remote::ProcessGDBRemote::WillPublicStop().

◆ operator[]()

ObjectSP lldb_private::StructuredData::Array::operator[] ( size_t  idx)
inline

Definition at line 210 of file StructuredData.h.

References m_items.

◆ Push()

void lldb_private::StructuredData::Array::Push ( const ObjectSP item)
inline

◆ Serialize()

void StructuredData::Array::Serialize ( llvm::json::OStream &  s) const
overridevirtual

Member Data Documentation

◆ m_items

collection lldb_private::StructuredData::Array::m_items
protected

Definition at line 295 of file StructuredData.h.

Referenced by AddItem(), ForEach(), GetItemAtIndex(), GetSize(), operator[](), and Push().


The documentation for this class was generated from the following files: