LLDB mainline
lldb_private::StructuredData::Dictionary Class Reference

#include <StructuredData.h>

Inheritance diagram for lldb_private::StructuredData::Dictionary:
[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
void Dump (lldb_private::Stream &s, bool pretty_print=true) 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

◆ 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,
T value )
inline

◆ AddItem()

◆ AddStringItem()

◆ ForEach()

◆ GetDescription()

◆ 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()

◆ GetValueForKeyAsArray()

◆ GetValueForKeyAsBoolean()

◆ GetValueForKeyAsDictionary()

◆ GetValueForKeyAsInteger() [1/2]

◆ 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.

References GetValueForKeyAsInteger().

◆ GetValueForKeyAsString() [1/2]

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

Definition at line 464 of file StructuredData.h.

References GetValueForKey().

Referenced by lldb_private::DynamicRegisterInfo::ByteOffsetFromRegInfoDict(), lldb_private::ScriptedThread::CalculateStopInfo(), lldb_private::BreakpointOptions::CommandData::CreateFromStructuredData(), lldb_private::BreakpointOptions::CreateFromStructuredData(), lldb_private::BreakpointResolver::CreateFromStructuredData(), lldb_private::BreakpointResolverAddress::CreateFromStructuredData(), lldb_private::BreakpointResolverFileLine::CreateFromStructuredData(), lldb_private::BreakpointResolverFileRegex::CreateFromStructuredData(), lldb_private::BreakpointResolverName::CreateFromStructuredData(), lldb_private::BreakpointResolverScripted::CreateFromStructuredData(), lldb_private::SearchFilter::CreateFromStructuredData(), lldb_private::ThreadSpec::CreateFromStructuredData(), CommandObjectTargetModulesDumpSeparateDebugInfoFiles::DoExecute(), DumpDwoFilesTable(), lldb_private::StructuredDataDarwinLog::DumpHeader(), DumpOsoFilesTable(), lldb_private::StructuredDataDarwinLog::GetDescription(), lldb_private::ScriptedProcess::GetLoadedDynamicLibrariesInfos(), GetValueForKeyAsString(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_jModulesInfo(), lldb_private::StructuredDataDarwinLog::HandleDisplayOfEvent(), ParseModuleSpec(), lldb_private::Process::RouteAsyncStructuredData(), lldb_private::DynamicRegisterInfo::SetRegisterInfo(), and lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo().

◆ 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()

◆ Serialize()

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

Implements lldb_private::StructuredData::Object.

Definition at line 163 of file StructuredData.cpp.

References m_dict.

Member Data Documentation

◆ m_dict

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

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