![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/serial2/XOMUnserializer.h>
Public Member Functions | |
XOMUnserializer (xom::Element *element) | |
XOMUnserializer (const char *path) | |
XOMUnserializer (cstring path) | |
XOMUnserializer (sys::Path path) | |
~XOMUnserializer (void) | |
ExternalSolver & | solver (void) const |
void | setSolver (ExternalSolver &solver) |
virtual void | flush (void) |
virtual void | beginObject (const rtti::Type &clazz, void *object) |
virtual void | endObject (const rtti::Type &clazz, void *object) |
virtual bool | beginField (CString name) |
virtual void | endField (void) |
virtual void | onPointer (const rtti::Type &clazz, void **object) |
virtual bool | beginCompound (void *) |
virtual int | countItems (void) |
virtual bool | nextItem (void) |
virtual void | endCompound (void *) |
virtual int | onEnum (const rtti::Type &clazz) |
virtual void | onValue (bool &v) |
virtual void | onValue (signed int &v) |
virtual void | onValue (unsigned int &v) |
virtual void | onValue (char &v) |
virtual void | onValue (signed char &v) |
virtual void | onValue (unsigned char &v) |
virtual void | onValue (signed short &v) |
virtual void | onValue (unsigned short &v) |
virtual void | onValue (signed long &v) |
virtual void | onValue (unsigned long &v) |
virtual void | onValue (signed long long &v) |
virtual void | onValue (unsigned long long &v) |
virtual void | onValue (float &v) |
virtual void | onValue (double &v) |
virtual void | onValue (long double &v) |
virtual void | onValue (CString &v) |
virtual void | onValue (String &v) |
![]() | |
virtual | ~Unserializer (void) |
Static Public Attributes | |
const static cstring | id_tag = "id" |
const static cstring | ref_tag = "ref" |
const static cstring | null_tag = "NULL" |
const static cstring | class_tag = "class" |
This class an unserializer for XML files using XOM module.
The XML file / node must meet the following rules:
XOMUnserializer | ( | xom::Element * | element | ) |
Build the unserializer for using the given element.
element | XOM element to use. |
References Node::getDocument().
XOMUnserializer | ( | const char * | path | ) |
Build an unserializer from the given XOM document.
path | Path document to unserialize from. |
XOMUnserializer | ( | cstring | path | ) |
Build an unserializer from the given XOM document.
path | Path document to unserialize from. |
XOMUnserializer | ( | sys::Path | path | ) |
Build an unserializer from the given XOM document.
path | Path document to unserialize from. |
References String::toCString(), and Path::toString().
~XOMUnserializer | ( | void | ) |
This function is called to unserialize a compound object, that is, an object containing a collection of values with the same type.
object | Compound object to unserialize. |
Implements Unserializer.
References Node::ELEMENT, Node::kind(), and Vector< T, E, A >::push().
Called to begin the unserialization of a field in an object.
This call is always preceded by call to beginObject() for the object containing the field and there is no more call to this function as soon as the corresponding endObject() call is performed.
Between a call to a beginField() and of a endField(), calls to the unserializer functions are performed to serialize the corresponding data.
name | Name of the field. |
Implements Unserializer.
References Vector< T, E, A >::push().
|
virtual |
Called to start the unserialization of a new object.
clazz | Object class descriptor. |
object | Unserialized object. |
Implements Unserializer.
|
virtual |
This function is called to get the count if items in a compound.
If it only called after a beginCompound() and before any to nextItem().
Implements Unserializer.
References Node::ELEMENT, and Node::kind().
This function is called at the end of a compound.
This function is only called after a call to beginCompound() and matches any call to beginCompound().
Implements Unserializer.
Called to end the unserialization of a field in an object.
This call is always preceded by call to beginField() and there is no more call to this function as soon as the corresponding endObject() call is performed.
Implements Unserializer.
References Vector< T, E, A >::pop().
|
virtual |
Called to finish the unserialization of an object. This function call is always preceded by a call to beginObject().
clazz | Object class descriptor. |
object | Unserialized object. |
Implements Unserializer.
Implements Unserializer.
References elm::_, Node::ELEMENT, HashMap< K, T, H, A, E >::get(), Element::getAttributeValue(), ParentNode::getChild(), ParentNode::getChildCount(), Document::getRootElement(), XOMUnserializer::id_tag, Node::kind(), elm::pair(), HashMap< K, T, H, A, E >::put(), and ExternalSolver::solve().
Afgter getting a value of a compound object, a call to this function must be performed.
This function call is always preceded by a call to beginCompound() and will not call anymore after a call to endCompound().
This call is followed by calls to other unserialization function in order to unserialize the value itself.
Implements Unserializer.
References Node::ELEMENT, Node::kind(), Vector< T, E, A >::pop(), and Vector< T, E, A >::push().
|
virtual |
Called when a value of type enumerate has to be unserialized.
clazz | Enumerated type. |
Implements Unserializer.
References elm::_, Type::asEnum(), String::free(), and Enumerable::valueFor().
|
virtual |
This function is called to unserialize a pointer to an object.
clazz | Class of the pointed object. |
object | Pointed object to unserialize. |
Implements Unserializer.
References XOMUnserializer::null_tag, elm::pair(), elm::t::ref(), and XOMUnserializer::ref_tag.
Called to unserialize a value of type boolean.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
virtual |
Implements Unserializer.
References String::free(), and Input::setStream().
Called to unserialize a value of type C string.
v | Reference to unserialize in. |
Implements Unserializer.
|
virtual |
Called to unserialize a value of type double-precision floating point.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
virtual |
Called to unserialize a value of type single-precision floating point.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
virtual |
Called to unserialize a value of type quadruple-precision floating point.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
virtual |
Implements Unserializer.
References String::free(), and Input::setStream().
|
virtual |
Called to unserialize a value of type signed integer.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
virtual |
Called to unserialize a value of type signed long integer.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
virtual |
Called to unserialize a value of type signed long long integer.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
virtual |
Called to unserialize a value of type signed short integer.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
Called to unserialize a value of type ELM string.
v | Reference to unserialize in. |
Implements Unserializer.
References String::free().
|
virtual |
Called to unserialize a value of type unsigned byte.
v | Reference to unserialize in. |
Implements Unserializer.
References String::free(), and Input::setStream().
|
virtual |
Called to unserialize a value of type unsigned integer.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
virtual |
Called to unserialize a value of type unsigned long integer.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
virtual |
Called to unserialize a value of type unsigned long long integer.
v | Value to serialize. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
virtual |
Called to unserialize a value of type unsigned short integer.
v | Reference to unserialize in. |
Implements Unserializer.
References elm::_, String::free(), and Input::setStream().
|
inline |
Set the current external solver.
solver | New solver to use. |
References XOMUnserializer::solver().
|
inline |
Get the current solver of external entities. External entities are objects provided by the application with which serialized objects ma be linked.
Referenced by XOMUnserializer::setSolver().
|
static |
|
static |
Referenced by XOMUnserializer::flush().
|
static |
Referenced by XOMUnserializer::onPointer().
|
static |
Referenced by XOMUnserializer::onPointer().