-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserializable.h
45 lines (34 loc) · 943 Bytes
/
serializable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef SERIALIZABLE_H
#define SERIALIZABLE_H
#include <QString>
#include <QMap>
#include <QStringList>
#include <QPair>
#include "user.h"
namespace qtxmpp {
class Serializable
{
public:
explicit Serializable();
static QByteArray serialize(Serializable *serializable);
static Serializable* deserialize();
QString getXmlns();
void setXmlns(QString xmlns);
QString getName();
void setName(QString name);
QMap<QString, QString> getAttributes();
QList<Serializable> getChildren();
void addChild(Serializable serializable);
Serializable getChild(int child);
void deleteChildren();
bool isText();
void setText(bool text);
protected:
QString m_xmlns;
QString m_name;
QMap<QString, QString> m_attributes;
QList<Serializable> m_children;
bool m_text;
};
}
#endif // SERIALIZABLE_H