LLDB  mainline
Public Member Functions | Protected Types | 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]
Collaboration diagram for lldb_private::StructuredData::Dictionary:
Collaboration graph
[legend]

Public Member Functions

 Dictionary ()
 
 ~Dictionary () override=default
 
size_t GetSize () const
 
void ForEach (std::function< bool(ConstString key, Object *object)> const &callback) const
 
ObjectSP 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 GetValueForKeyAsString (llvm::StringRef key, ConstString &result) const
 
bool GetValueForKeyAsString (llvm::StringRef key, ConstString &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)
 
void AddIntegerItem (llvm::StringRef key, uint64_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 Dump (Stream &s, bool pretty_print=true) 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
 

Protected Types

typedef std::map< ConstString, ObjectSPcollection
 

Protected Attributes

collection m_dict
 

Detailed Description

Definition at line 348 of file StructuredData.h.

Member Typedef Documentation

◆ collection

Definition at line 514 of file StructuredData.h.

Constructor & Destructor Documentation

◆ Dictionary()

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

Definition at line 350 of file StructuredData.h.

◆ ~Dictionary()

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

Member Function Documentation

◆ AddBooleanItem()

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

◆ AddFloatItem()

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

Definition at line 499 of file StructuredData.h.

◆ AddIntegerItem()

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

◆ 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

◆ Dump()

void StructuredData::Dictionary::Dump ( Stream s,
bool  pretty_print = true 
) const
overridevirtual

◆ ForEach()

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

◆ GetKeys()

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

Definition at line 364 of file StructuredData.h.

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

◆ GetSize()

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

Definition at line 354 of file StructuredData.h.

◆ 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 411 of file StructuredData.h.

◆ GetValueForKeyAsString() [1/4]

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

◆ GetValueForKeyAsString() [2/4]

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

Definition at line 431 of file StructuredData.h.

◆ GetValueForKeyAsString() [3/4]

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

Definition at line 443 of file StructuredData.h.

◆ GetValueForKeyAsString() [4/4]

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

Definition at line 455 of file StructuredData.h.

References lldb_private::ConstString::SetCString().

◆ HasKey()

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

Member Data Documentation

◆ m_dict

collection lldb_private::StructuredData::Dictionary::m_dict
protected

Definition at line 515 of file StructuredData.h.


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