cubos::core::data::DebugSerializer class

Serializer implementation which prints the given data to a stream in a human-readable format not meant to be parsed.

Base classes

class Serializer
Base class for serializers, which defines the interface for serializing arbitrary data using its reflection metadata.

Constructors, destructors, conversion operators

DebugSerializer(memory::Stream& stream)
Constructs.

Public functions

void pretty(bool pretty)
Sets whether to pretty-print the output.

Protected functions

auto decompose(const reflection::Type& type, const void* value) -> bool override
Called for each type with no hook defined.

Function documentation

cubos::core::data::DebugSerializer::DebugSerializer(memory::Stream& stream)

Constructs.

Parameters
stream Stream to serialize to.

void cubos::core::data::DebugSerializer::pretty(bool pretty)

Sets whether to pretty-print the output.

Parameters
pretty Whether to pretty-print the output.

bool cubos::core::data::DebugSerializer::decompose(const reflection::Type& type, const void* value) override protected

Called for each type with no hook defined.

Parameters
type Type.
value Value.
Returns Whether the value was successfully serialized.

Should recurse by calling write() again as appropriate.