C4 Engine
C4 Engine API Documentation

class Unpacker

Defined in:  C4Packing.h
Represents an input deserialization stream.
Definition

class Unpacker

Member Functions
Unpacker::GetType Returns the generic type appearing next in the input stream.
Unpacker::ReadData Reads arbitrary data from the input stream.
Unpacker::ReadArray Reads an array of objects from the input stream.
Unpacker::AddObjectLink Adds an object link that will be resolved after unpacking is complete.
Unpacker::AddNodeLink Adds a node link that will be resolved after unpacking is complete.
Constructor

Unpacker(const void *ptr, int32 version = 0);

Parameters
ptr A pointer to a memory block containing the packed data.
version The storage format version of the packed data. The constant kEngineInternalVersion corresponds to the current version.
Description
A Unpacker object is passed to the Packable::Unpack function when the engine needs to deserialize data to be stored in an object. The Unpacker object encapsulates an input serialization stream, and the >> operator is typically used to read data from it.
Overloaded Operators
template <typename type> Unpacker& operator >>(type& data); Reads the data given by the data parameter from the input stream.
Unpacker& operator >>(bool& data); Reads the boolean value given by the data parameter from the input stream.
template <int32 len> Unpacker& operator >>(String<len>& string); Reads the string given by the string parameter from the input stream.
See Also

Packer

Packable