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]
Collaboration diagram for lldb_private::StructuredData::Array:
Collaboration 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 >
bool GetItemAtIndexAsInteger (size_t idx, IntType &result) const
 
template<class IntType >
bool GetItemAtIndexAsInteger (size_t idx, IntType &result, IntType default_val) const
 
bool GetItemAtIndexAsString (size_t idx, llvm::StringRef &result) const
 
bool GetItemAtIndexAsString (size_t idx, llvm::StringRef &result, llvm::StringRef default_val) const
 
bool GetItemAtIndexAsString (size_t idx, ConstString &result) const
 
bool GetItemAtIndexAsString (size_t idx, ConstString &result, const char *default_val) const
 
bool GetItemAtIndexAsDictionary (size_t idx, Dictionary *&result) const
 
bool GetItemAtIndexAsArray (size_t idx, Array *&result) const
 
void Push (const ObjectSP &item)
 
void AddItem (const ObjectSP &item)
 
void Serialize (llvm::json::OStream &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 ()
 
IntegerGetAsInteger ()
 
uint64_t GetIntegerValue (uint64_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
 
void Dump (lldb_private::Stream &s, bool pretty_print=true) const
 

Protected Types

typedef std::vector< ObjectSPcollection
 

Protected Attributes

collection m_items
 

Detailed Description

Definition at line 165 of file StructuredData.h.

Member Typedef Documentation

◆ collection

Definition at line 281 of file StructuredData.h.

Constructor & Destructor Documentation

◆ Array()

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

Definition at line 167 of file StructuredData.h.

◆ ~Array()

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

Member Function Documentation

◆ AddItem()

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

◆ ForEach()

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

◆ GetItemAtIndex()

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

◆ GetItemAtIndexAsArray()

bool lldb_private::StructuredData::Array::GetItemAtIndexAsArray ( size_t  idx,
Array *&  result 
) const
inline

◆ GetItemAtIndexAsDictionary()

bool lldb_private::StructuredData::Array::GetItemAtIndexAsDictionary ( size_t  idx,
Dictionary *&  result 
) const
inline

◆ GetItemAtIndexAsInteger() [1/2]

template<class IntType >
bool lldb_private::StructuredData::Array::GetItemAtIndexAsInteger ( size_t  idx,
IntType &  result 
) const
inline

◆ GetItemAtIndexAsInteger() [2/2]

template<class IntType >
bool lldb_private::StructuredData::Array::GetItemAtIndexAsInteger ( size_t  idx,
IntType &  result,
IntType  default_val 
) const
inline

Definition at line 208 of file StructuredData.h.

References GetItemAtIndexAsInteger().

◆ GetItemAtIndexAsString() [1/4]

bool lldb_private::StructuredData::Array::GetItemAtIndexAsString ( size_t  idx,
ConstString result 
) const
inline

Definition at line 235 of file StructuredData.h.

References GetItemAtIndex().

◆ GetItemAtIndexAsString() [2/4]

bool lldb_private::StructuredData::Array::GetItemAtIndexAsString ( size_t  idx,
ConstString result,
const char *  default_val 
) const
inline

◆ GetItemAtIndexAsString() [3/4]

bool lldb_private::StructuredData::Array::GetItemAtIndexAsString ( size_t  idx,
llvm::StringRef &  result 
) const
inline

◆ GetItemAtIndexAsString() [4/4]

bool lldb_private::StructuredData::Array::GetItemAtIndexAsString ( size_t  idx,
llvm::StringRef &  result,
llvm::StringRef  default_val 
) const
inline

Definition at line 227 of file StructuredData.h.

References GetItemAtIndexAsString().

◆ GetSize()

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

Definition at line 180 of file StructuredData.h.

References m_items.

Referenced by lldb_private::Target::CreateBreakpointsFromFile(), lldb_private::BreakpointResolverFileRegex::CreateFromStructuredData(), lldb_private::BreakpointResolverName::CreateFromStructuredData(), lldb_private::BreakpointOptions::CommandData::CreateFromStructuredData(), lldb_private::Breakpoint::CreateFromStructuredData(), lldb_private::SearchFilterByModule::CreateFromStructuredData(), lldb_private::SearchFilterByModuleList::CreateFromStructuredData(), lldb_private::SearchFilterByModuleListAndCU::CreateFromStructuredData(), lldb_private::Thread::GetDescription(), 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(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::QueryGDBServer(), lldb_private::Breakpoint::SerializedBreakpointMatchesNames(), 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 182 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

Implements lldb_private::StructuredData::Object.

Definition at line 134 of file StructuredData.cpp.

Member Data Documentation

◆ m_items

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

Definition at line 282 of file StructuredData.h.

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


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