Blender V5.0
blender::io::serialize::DictionaryValue Class Reference

#include <BLI_serialize.hh>

Inherits blender::io::serialize::Value.

Public Types

using Item = std::pair<std::string, std::shared_ptr<Value>>
using Lookup = Map<std::string, std::shared_ptr<Value>>

Public Member Functions

 DictionaryValue ()
Lookup create_lookup () const
const std::shared_ptr< Value > * lookup (StringRef key) const
std::optional< StringRefNulllookup_str (StringRef key) const
std::optional< int64_tlookup_int (StringRef key) const
std::optional< double > lookup_double (StringRef key) const
const DictionaryValuelookup_dict (StringRef key) const
const ArrayValuelookup_array (StringRef key) const
Span< Itemelements () const
void append (std::string key, std::shared_ptr< Value > value)
void append_int (std::string key, int64_t value)
void append_double (std::string key, double value)
void append_str (std::string key, std::string value)
std::shared_ptr< DictionaryValueappend_dict (std::string key)
std::shared_ptr< ArrayValueappend_array (std::string key)
Public Member Functions inherited from blender::io::serialize::Value
 Value ()=delete
virtual ~Value ()=default
eValueType type () const
const StringValueas_string_value () const
const IntValueas_int_value () const
const DoubleValueas_double_value () const
const BooleanValueas_boolean_value () const
const EnumValueas_enum_value () const
const ArrayValueas_array_value () const
const DictionaryValueas_dictionary_value () const

Additional Inherited Members

Protected Member Functions inherited from blender::io::serialize::Value
 Value (eValueType type)

Detailed Description

Object is a key-value container where the key must be a std::string. Internally it is stored in a blender::Vector to ensure the order of keys.

Definition at line 234 of file BLI_serialize.hh.

Member Typedef Documentation

◆ Item

using blender::io::serialize::DictionaryValue::Item = std::pair<std::string, std::shared_ptr<Value>>

Elements are stored as an key value pair. The value is a shared pointer so it can be shared when using DictionaryValue::create_lookup.

Definition at line 240 of file BLI_serialize.hh.

◆ Lookup

using blender::io::serialize::DictionaryValue::Lookup = Map<std::string, std::shared_ptr<Value>>

Definition at line 241 of file BLI_serialize.hh.

Constructor & Destructor Documentation

◆ DictionaryValue()

blender::io::serialize::DictionaryValue::DictionaryValue ( )
inline

Definition at line 247 of file BLI_serialize.hh.

References blender::io::serialize::Value::Value().

Referenced by lookup_dict().

Member Function Documentation

◆ append()

void blender::io::serialize::DictionaryValue::append ( std::string key,
std::shared_ptr< Value > value )

◆ append_array()

std::shared_ptr< ArrayValue > blender::io::serialize::DictionaryValue::append_array ( std::string key)

Definition at line 348 of file serialize.cc.

References append().

Referenced by blender::bke::bake::serialize_bake_item().

◆ append_dict()

std::shared_ptr< DictionaryValue > blender::io::serialize::DictionaryValue::append_dict ( std::string key)

◆ append_double()

void blender::io::serialize::DictionaryValue::append_double ( std::string key,
double value )

Definition at line 331 of file serialize.cc.

References append().

◆ append_int()

void blender::io::serialize::DictionaryValue::append_int ( std::string key,
int64_t value )

◆ append_str()

void blender::io::serialize::DictionaryValue::append_str ( std::string key,
std::string value )

Definition at line 336 of file serialize.cc.

References append().

Referenced by blender::bke::bake::serialize_bake_item().

◆ create_lookup()

DictionaryValue::Lookup blender::io::serialize::DictionaryValue::create_lookup ( ) const

Return a lookup map to quickly lookup by key.

The lookup is owned by the caller.

Definition at line 256 of file serialize.cc.

References result.

◆ elements()

Span< Item > blender::io::serialize::DictionaryValue::elements ( ) const
inline

◆ lookup()

const std::shared_ptr< Value > * blender::io::serialize::DictionaryValue::lookup ( StringRef key) const

◆ lookup_array()

◆ lookup_dict()

◆ lookup_double()

std::optional< double > blender::io::serialize::DictionaryValue::lookup_double ( StringRef key) const

Definition at line 295 of file serialize.cc.

References lookup().

◆ lookup_int()

◆ lookup_str()


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