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

#include <BLI_serialize.hh>

Inherits blender::io::serialize::Formatter.

Public Member Functions

void serialize (std::ostream &os, const Value &value) override
std::unique_ptr< Valuedeserialize (std::istream &is) override
Public Member Functions inherited from blender::io::serialize::Formatter
virtual ~Formatter ()=default

Public Attributes

int8_t indentation_len = 0

Detailed Description

Formatter to (de)serialize a JSON formatted stream.

Definition at line 292 of file BLI_serialize.hh.

Member Function Documentation

◆ deserialize()

std::unique_ptr< Value > blender::io::serialize::JsonFormatter::deserialize ( std::istream & is)
overridevirtual
Returns
The de-serialized value or null on failure to parse the JSON contents. Typically this indicates a malformed file.

Implements blender::io::serialize::Formatter.

Definition at line 367 of file serialize.cc.

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

Referenced by blender::bke::bake::deserialize_bake(), blender::ed::asset::index::AssetIndexFile::read_contents(), and blender::io::serialize::read_json_file().

◆ serialize()

void blender::io::serialize::JsonFormatter::serialize ( std::ostream & os,
const Value & value )
overridevirtual

Member Data Documentation

◆ indentation_len

int8_t blender::io::serialize::JsonFormatter::indentation_len = 0

The indentation level to use. Typically number of chars. Set to 0 to not use indentation.

Definition at line 298 of file BLI_serialize.hh.

Referenced by serialize().


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