XmlDeserializer Class Reference

#include <Pt/Xml/XmlDeserializer.h>

Deserialize objects and data from XML.

Inherits Deserializer.

Public Member Functions

 XmlDeserializer ()
 Default Constructor.
 
 XmlDeserializer (XmlReader &reader)
 Construct to use an XmlReader.
 
void attach (XmlReader &reader)
 Attach to an XmlReader.
 
void detach ()
 Detach from its XmlReader.
 
XmlReaderreader ()
 Returns the attached XmlReader or a nullptr.
 
SerializationContextcontext ()
 Returns the used context.
 
void reset (SerializationContext *context)
 Clears and resets the context.
 
Formatterformatter ()
 Returns the used formatter to use.
 
void setFormatter (Formatter &formatter)
 Sets the formatter.
 
void clear ()
 Clears all content.
 
template<typename T >
void begin (T &t)
 Starts parsing of an object. More...
 
bool advance ()
 Advances parsing of an object. More...
 
void finish ()
 Finishes parsing of an object. More...
 
void fixup ()
 Fixes up references. More...
 

Member Function Documentation

◆ begin()

void begin ( T &  t)
inherited

This method will begin to parse the object t. The type t must be serializable. Parsing can be completed by calling advance() repeatedly, or by calling finish().

◆ advance()

bool advance ( )
inherited

Returns true if the object passed to begin() could be parsed completely, otherwise false is returned. If false is returned, no further progress can be made, until more data becomes available. When parsing is complete, references can be fixed up by calling fixup().

◆ finish()

void finish ( )
inherited

This method will finish parsing of the object started by begin(). After all objects have been parsed, references can be fixed up by calling fixup()

◆ fixup()

void fixup ( )
inherited

Weak references between the parsed objects can be fixed up calling this method. Fixup has to happen after all objects have been parsed so references can be forward and backward in the object stream.