Blender
V3.3
|
#include <BLI_serialize.hh>
Public Member Functions | |
virtual | ~Value ()=default |
eValueType | type () const |
const StringValue * | as_string_value () const |
const IntValue * | as_int_value () const |
const DoubleValue * | as_double_value () const |
const BooleanValue * | as_boolean_value () const |
const ArrayValue * | as_array_value () const |
const DictionaryValue * | as_dictionary_value () const |
Protected Member Functions | |
Value ()=delete | |
Value (eValueType type) | |
Class containing a (de)serializable value.
To serialize from or to a specific format the Value will be used as an intermediate container holding the values. Value class is abstract. There are concrete classes to for different data types.
StringValue
: contains a string.IntValue
: contains an integer.ArrayValue
: contains an array of elements. Elements don't need to be the same type.NullValue
: represents nothing (null pointer or optional).BooleanValue
: contains a boolean (true/false).DoubleValue
: contains a double precision floating point number.DictionaryValue
: represents an object (key value pairs where keys are strings and values can be of different types. Definition at line 115 of file BLI_serialize.hh.
|
protecteddelete |
|
inlineexplicitprotected |
Definition at line 121 of file BLI_serialize.hh.
|
virtualdefault |
const ArrayValue * blender::io::serialize::Value::as_array_value | ( | ) | const |
Casts to an ArrayValue. Will return nullptr when it is a different type.
Definition at line 41 of file serialize.cc.
References blender::io::serialize::Array.
Referenced by blender::ed::asset::index::AssetEntryReader::add_tags_to_meta_data(), blender::bke::idprop::convert_from_serialize_value(), and blender::io::serialize::convert_to_json().
const BooleanValue * blender::io::serialize::Value::as_boolean_value | ( | ) | const |
Casts to a BooleanValue. Will return nullptr when it is a different type.
Definition at line 33 of file serialize.cc.
References blender::io::serialize::Boolean.
Referenced by blender::io::serialize::convert_to_json().
const DictionaryValue * blender::io::serialize::Value::as_dictionary_value | ( | ) | const |
Casts to an DictionaryValue. Will return nullptr when it is a different type.
Definition at line 49 of file serialize.cc.
References blender::io::serialize::Dictionary.
Referenced by blender::io::serialize::convert_to_json(), blender::ed::asset::index::AssetIndex::extract_into(), blender::ed::asset::index::AssetIndex::get_version(), blender::bke::idprop::tests::test_array_to_value(), blender::bke::idprop::tests::test_double_to_value(), blender::bke::idprop::tests::test_float_to_value(), blender::bke::idprop::tests::test_int_to_value(), and blender::bke::idprop::tests::test_string_to_value().
const DoubleValue * blender::io::serialize::Value::as_double_value | ( | ) | const |
Casts to a DoubleValue. Will return nullptr when it is a different type.
Definition at line 25 of file serialize.cc.
References blender::io::serialize::Double.
Referenced by blender::io::serialize::convert_to_json().
const IntValue * blender::io::serialize::Value::as_int_value | ( | ) | const |
Casts to an IntValue. Will return nullptr when it is a different type.
Definition at line 17 of file serialize.cc.
References blender::io::serialize::Int.
Referenced by blender::io::serialize::convert_to_json(), and blender::ed::asset::index::AssetIndex::get_version().
const StringValue * blender::io::serialize::Value::as_string_value | ( | ) | const |
Casts to a StringValue. Will return nullptr when it is a different type.
Definition at line 9 of file serialize.cc.
References blender::io::serialize::String.
Referenced by blender::io::serialize::convert_to_json().
|
inline |
Definition at line 127 of file BLI_serialize.hh.
Referenced by blender::bke::idprop::tests::check_container_value(), blender::bke::idprop::convert_from_serialize_value(), and blender::io::serialize::convert_to_json().