#include <Pt/Serializer.h>
Serializes a set of types.
Inherited by XmlSerializer.
Public Member Functions | |
Serializer () | |
Default constructor. | |
virtual | ~Serializer () |
Destructor. | |
bool | advance () |
Advances formatting of the object set. More... | |
template<typename T > | |
void | begin (const T &type, const char *name) |
Begins serialization of an object. More... | |
void | clear () |
Clears all content. | |
SerializationContext * | context () |
Returns the used context. | |
void | finish () |
Finishes parsing of the object set. More... | |
Formatter * | formatter () |
Returns the used formatter. | |
void | reset (SerializationContext *context) |
Clears the serializer and sets a new context. | |
void | setFormatter (Formatter &formatter) |
Returns formatter to use. | |
void begin | ( | const T & | type, |
const char * | name | ||
) |
This method has to be called for each object to be part of the object stream before formatting is done by calling advance() or finish(). This is neccessary, because reference IDs have to be assigned to referenced objects before they can formatted. The string name will be used as the instance name of type. The type must be serializable.
bool advance | ( | ) |