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

#include <StructuredData.h>

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

Public Member Functions

 Dictionary ()
 
 Dictionary (ObjectSP obj_sp)
 
 ~Dictionary () override=default
 
size_t GetSize () const
 
void ForEach (std::function< bool(llvm::StringRef key, Object *object)> const &callback) const
 
ArraySP GetKeys () const
 
ObjectSP GetValueForKey (llvm::StringRef key) const
 
bool GetValueForKeyAsBoolean (llvm::StringRef key, bool &result) const
 
template<class IntType >
bool GetValueForKeyAsInteger (llvm::StringRef key, IntType &result) const
 
template<class IntType >
bool GetValueForKeyAsInteger (llvm::StringRef key, IntType &result, IntType default_val) const
 
bool GetValueForKeyAsString (llvm::StringRef key, llvm::StringRef &result) const
 
bool GetValueForKeyAsString (llvm::StringRef key, llvm::StringRef &result, const char *default_val) const
 
bool GetValueForKeyAsDictionary (llvm::StringRef key, Dictionary *&result) const
 
bool GetValueForKeyAsArray (llvm::StringRef key, Array *&result) const
 
bool HasKey (llvm::StringRef key) const
 
void AddItem (llvm::StringRef key, ObjectSP value_sp)
 
template<typename T >
void AddIntegerItem (llvm::StringRef key, T value)
 
void AddFloatItem (llvm::StringRef key, double value)
 
void AddStringItem (llvm::StringRef key, llvm::StringRef value)
 
void AddBooleanItem (llvm::StringRef key, 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 Attributes

llvm::StringMap< ObjectSPm_dict
 

Detailed Description

Definition at line 384 of file StructuredData.h.

Constructor & Destructor Documentation

◆ Dictionary() [1/2]

lldb_private::StructuredData::Dictionary::Dictionary ( )
inline

Definition at line 386 of file StructuredData.h.

◆ Dictionary() [2/2]

lldb_private::StructuredData::Dictionary::Dictionary ( ObjectSP  obj_sp)
inline

◆ ~Dictionary()

lldb_private::StructuredData::Dictionary::~Dictionary ( )
overridedefault

Member Function Documentation

◆ AddBooleanItem()

void lldb_private::StructuredData::Dictionary::AddBooleanItem ( llvm::StringRef  key,
bool  value 
)
inline

Definition at line 533 of file StructuredData.h.

References AddItem().

Referenced by sddarwinlog_private::FilterRule::Serialize().

◆ AddFloatItem()

void lldb_private::StructuredData::Dictionary::AddFloatItem ( llvm::StringRef  key,
double  value 
)
inline

Definition at line 525 of file StructuredData.h.

References AddItem().

◆ AddIntegerItem()

template<typename T >
void lldb_private::StructuredData::Dictionary::AddIntegerItem ( llvm::StringRef  key,
value 
)
inline

Definition at line 515 of file StructuredData.h.

References AddItem().

Referenced by SystemRuntimeMacOSX::AddThreadExtendedInfoPacketHints().

◆ AddItem()

void lldb_private::StructuredData::Dictionary::AddItem ( llvm::StringRef  key,
ObjectSP  value_sp 
)
inline

◆ AddStringItem()

void lldb_private::StructuredData::Dictionary::AddStringItem ( llvm::StringRef  key,
llvm::StringRef  value 
)
inline

◆ ForEach()

void lldb_private::StructuredData::Dictionary::ForEach ( std::function< bool(llvm::StringRef key, Object *object)> const &  callback) const
inline

◆ GetDescription()

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

◆ GetKeys()

ArraySP lldb_private::StructuredData::Dictionary::GetKeys ( ) const
inline

Definition at line 410 of file StructuredData.h.

References m_dict.

Referenced by lldb::SBStructuredData::GetKeys().

◆ GetSize()

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

◆ GetValueForKey()

ObjectSP lldb_private::StructuredData::Dictionary::GetValueForKey ( llvm::StringRef  key) const
inline

◆ GetValueForKeyAsArray()

bool lldb_private::StructuredData::Dictionary::GetValueForKeyAsArray ( llvm::StringRef  key,
Array *&  result 
) const
inline

◆ GetValueForKeyAsBoolean()

bool lldb_private::StructuredData::Dictionary::GetValueForKeyAsBoolean ( llvm::StringRef  key,
bool &  result 
) const
inline

◆ GetValueForKeyAsDictionary()

bool lldb_private::StructuredData::Dictionary::GetValueForKeyAsDictionary ( llvm::StringRef  key,
Dictionary *&  result 
) const
inline

◆ GetValueForKeyAsInteger() [1/2]

template<class IntType >
bool lldb_private::StructuredData::Dictionary::GetValueForKeyAsInteger ( llvm::StringRef  key,
IntType &  result 
) const
inline

◆ GetValueForKeyAsInteger() [2/2]

template<class IntType >
bool lldb_private::StructuredData::Dictionary::GetValueForKeyAsInteger ( llvm::StringRef  key,
IntType &  result,
IntType  default_val 
) const
inline

Definition at line 456 of file StructuredData.h.

◆ GetValueForKeyAsString() [1/2]

bool lldb_private::StructuredData::Dictionary::GetValueForKeyAsString ( llvm::StringRef  key,
llvm::StringRef &  result 
) const
inline

◆ GetValueForKeyAsString() [2/2]

bool lldb_private::StructuredData::Dictionary::GetValueForKeyAsString ( llvm::StringRef  key,
llvm::StringRef &  result,
const char *  default_val 
) const
inline

Definition at line 476 of file StructuredData.h.

References GetValueForKeyAsString().

◆ HasKey()

bool lldb_private::StructuredData::Dictionary::HasKey ( llvm::StringRef  key) const
inline

◆ Serialize()

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

Implements lldb_private::StructuredData::Object.

Definition at line 163 of file StructuredData.cpp.

Member Data Documentation

◆ m_dict

llvm::StringMap<ObjectSP> lldb_private::StructuredData::Dictionary::m_dict
protected

Definition at line 542 of file StructuredData.h.

Referenced by AddItem(), Dictionary(), ForEach(), GetKeys(), GetSize(), GetValueForKey(), and HasKey().


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