KanoopCommonQt 2.1.1
Kanoop foundational Qt utility library
Loading...
Searching...
No Matches
iserializabletoxml.h
1/**
2 * @brief Interfaces for serializing objects to XML.
3 */
4#ifndef ISERIALIZABLETOXML_H
5#define ISERIALIZABLETOXML_H
6#include <QDomDocument>
7#include <QList>
8
9/**
10 * @brief Interface for objects that can serialize themselves to a raw XML byte array.
11 */
13{
14public:
15 /**
16 * @brief Serialize this object to an XML byte array.
17 * @return UTF-8 encoded XML representation of this object
18 */
19 virtual QByteArray serializeToXml() const = 0;
20};
21
22/**
23 * @brief Interface for objects that can serialize themselves to a QDomElement.
24 */
26{
27public:
28 /**
29 * @brief Serialize this object into a QDomElement.
30 * @return DOM element representing this object
31 */
32 virtual QDomElement serializeToDomElement() const = 0;
33};
34
35/**
36 * @brief Interface for objects that can serialize themselves to a list of QDomElements.
37 */
39{
40public:
41 /**
42 * @brief Serialize this object into a list of QDomElements.
43 * @return List of DOM elements representing this object's data
44 */
45 virtual QList<QDomElement> serializeToDomElementList() const = 0;
46};
47
48#endif // ISERIALIZABLETOXML_H
Interface for objects that can serialize themselves to a list of QDomElements.
virtual QList< QDomElement > serializeToDomElementList() const =0
Serialize this object into a list of QDomElements.
Interface for objects that can serialize themselves to a QDomElement.
virtual QDomElement serializeToDomElement() const =0
Serialize this object into a QDomElement.
Interfaces for serializing objects to XML.
virtual QByteArray serializeToXml() const =0
Serialize this object to an XML byte array.