XML Serializer namespace that has handles the (de)serialize dispatching. More...
Classes | |
| class | Trait |
| Trait class for compile time separation of different kinds of serializable objects. More... | |
Functions | |
| template<typename T > | |
| std::remove_cv< T >::type | deserialize (const ArchiveElement &element) |
| Deserializes an element. More... | |
| template<typename T > | |
| std::remove_cv< T >::type | deserializeXML (const DOMElement &element) |
| Compatibility function that deserializes DOMElement. More... | |
| template<typename T > | |
| T | deserializeXML (const QString &filename) |
| Deserialize object from a XML file. More... | |
| template<typename T > | |
| ArchiveElement | serialize (Archive &archive, const T &t) |
| Serializes object t to new element that is added to the archive. More... | |
| template<typename T > | |
| bool | serializeXML (const QString &filename, const T &t, unsigned int opts=SerializationOptions::DEFAULTS) |
| Serialize object to a XML file. More... | |
XML Serializer namespace that has handles the (de)serialize dispatching.
Correct way to save/load object state to/from XML is to use static serialize/deserialize methods.
| std::remove_cv<T>::type Valuable::Serializer::deserialize | ( | const ArchiveElement & | element | ) |
Deserializes an element.
If deserialization fails or the template type is not compatible with the data in the element, an object of T created by its default constructor or NULL is returned.
| element | Serialized element that holds the data that should be deserialized. |
| std::remove_cv<T>::type Valuable::Serializer::deserializeXML | ( | const DOMElement & | element | ) |
Compatibility function that deserializes DOMElement.
Use deserialize(const ArchiveElement&) instead.
| element | XML element that is deserialized |
|
inline |
Deserialize object from a XML file.
Example usage:
| filename | Name of the XML file |
| ArchiveElement Valuable::Serializer::serialize | ( | Archive & | archive, |
| const T & | t | ||
| ) |
Serializes object t to new element that is added to the archive.
| archive | The serializer archive that is used to create the new element and maintains the serialization state and options. |
| t | Object to be serialized |
|
inline |
Serialize object to a XML file.
Example usage:
| filename | output xml filename |
| t | Object to be serialized |
| opts | Bitmask of SerializationOptions::Options |