Blender V4.3
blender::io::serialize Namespace Reference

Namespaces

namespace  json
 

Classes

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

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

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

◆ convert_from_json_to_array()

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

Definition at line 141 of file serialize.cc.

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

Referenced by convert_from_json().

◆ convert_from_json_to_object()

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

Definition at line 150 of file serialize.cc.

References convert_from_json().

Referenced by convert_from_json().

◆ convert_to_json() [1/3]

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

Definition at line 69 of file serialize.cc.

References convert_to_json().

◆ convert_to_json() [2/3]

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

Definition at line 81 of file serialize.cc.

References convert_to_json().

◆ convert_to_json() [3/3]

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

◆ 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 375 of file serialize.cc.

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