Blender V5.0
blender::io::serialize Namespace Reference

Namespaces

namespace  json

Classes

class  PrimitiveValue
class  Value
class  NullValue
class  StringValue
class  ArrayValue
class  DictionaryValue
class  Formatter
class  JsonFormatter

Typedefs

using IntValue = PrimitiveValue<int64_t, eValueType::Int>
using DoubleValue = PrimitiveValue<double, eValueType::Double>
using BooleanValue = PrimitiveValue<bool, eValueType::Boolean>
using EnumValue = PrimitiveValue<int, eValueType::Enum>

Enumerations

enum class  eValueType {
  String , Int , Array , Null ,
  Boolean , Double , Dictionary , Enum
}

Functions

void write_json_file (StringRef path, const Value &value)
std::shared_ptr< Valueread_json_file (StringRef path)
static void convert_to_json (nlohmann::ordered_json &j, const Value &value)
static void convert_to_json (nlohmann::ordered_json &j, const ArrayValue &value)
static void convert_to_json (nlohmann::ordered_json &j, const DictionaryValue &value)
static std::unique_ptr< Valueconvert_from_json (const nlohmann::ordered_json &j)
static std::unique_ptr< ArrayValueconvert_from_json_to_array (const nlohmann::ordered_json &j)
static std::unique_ptr< DictionaryValueconvert_from_json_to_object (const nlohmann::ordered_json &j)

Typedef Documentation

◆ BooleanValue

◆ DoubleValue

◆ EnumValue

◆ IntValue

Enumeration Type Documentation

◆ eValueType

Enumeration containing all sub-classes of Value. It is used as for type checking.

See also
#Value::type()
Enumerator
String 
Int 
Array 
Null 
Boolean 
Double 
Dictionary 
Enum 

Definition at line 75 of file BLI_serialize.hh.

Function Documentation

◆ convert_from_json()

std::unique_ptr< Value > blender::io::serialize::convert_from_json ( const nlohmann::ordered_json & j)
static

◆ convert_from_json_to_array()

std::unique_ptr< ArrayValue > blender::io::serialize::convert_from_json_to_array ( const nlohmann::ordered_json & j)
static

Definition at line 145 of file serialize.cc.

References array< T, alignment >::append(), convert_from_json(), and element.

Referenced by convert_from_json().

◆ convert_from_json_to_object()

std::unique_ptr< DictionaryValue > blender::io::serialize::convert_from_json_to_object ( const nlohmann::ordered_json & j)
static

Definition at line 154 of file serialize.cc.

References convert_from_json(), and element.

Referenced by convert_from_json().

◆ convert_to_json() [1/3]

void blender::io::serialize::convert_to_json ( nlohmann::ordered_json & j,
const ArrayValue & value )
static

◆ convert_to_json() [2/3]

void blender::io::serialize::convert_to_json ( nlohmann::ordered_json & j,
const DictionaryValue & value )
static

◆ convert_to_json() [3/3]

◆ read_json_file()

std::shared_ptr< Value > blender::io::serialize::read_json_file ( StringRef path)

◆ write_json_file()

void blender::io::serialize::write_json_file ( StringRef path,
const Value & value )

Definition at line 379 of file serialize.cc.

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