1 #ifndef INCLUDE_SIMPLESERIALIZER_H 2 #define INCLUDE_SIMPLESERIALIZER_H 13 void writeS32(quint32
id, qint32 value);
14 void writeU32(quint32
id, quint32 value);
15 void writeS64(quint32
id, qint64 value);
16 void writeU64(quint32
id, quint64 value);
17 void writeFloat(quint32
id,
float value);
18 void writeDouble(quint32
id,
double value);
22 writeFloat(
id, value);
23 else writeDouble(
id, value);
25 void writeBool(quint32
id,
bool value);
26 void writeString(quint32
id,
const QString& value);
27 void writeBlob(quint32
id,
const QByteArray& value);
29 const QByteArray&
final();
48 bool writeTag(
Type type, quint32
id, quint32 length);
55 bool readS32(quint32
id, qint32* result, qint32 def = 0)
const;
56 bool readU32(quint32
id, quint32* result, quint32 def = 0)
const;
57 bool readS64(quint32
id, qint64* result, qint64 def = 0)
const;
58 bool readU64(quint32
id, quint64* result, quint64 def = 0)
const;
59 bool readFloat(quint32
id,
float* result,
float def = 0)
const;
60 bool readDouble(quint32
id,
double* result,
double def = 0)
const;
61 bool readReal(quint32
id,
Real* result,
Real def = 0)
const;
62 bool readBool(quint32
id,
bool* result,
bool def =
false)
const;
63 bool readString(quint32
id, QString* result,
const QString& def = QString::null)
const;
64 bool readBlob(quint32
id, QByteArray* result,
const QByteArray& def = QByteArray())
const;
103 bool readTag(uint* readOfs, uint readEnd,
Type* type, quint32*
id, quint32* length)
const;
106 quint8 res = m_data[*readOfs];
112 #endif // INCLUDE_SIMPLESERIALIZER_H
quint8 readByte(uint *readOfs) const
Element(Type _type, quint32 _ofs, quint32 _length)
quint32 getVersion() const
void writeReal(quint32 id, Real value)
QMap< quint32, Element > Elements