Torc  0.1
torcbinaryplistserialiser.h
Go to the documentation of this file.
1 #ifndef TORCBINARYPLISTSERIALISER_H
2 #define TORCBINARYPLISTSERIALISER_H
3 
4 // Qt
5 #include <QDataStream>
6 
7 // Torc
8 #include "torcserialiser.h"
9 
11 {
12  public:
14  virtual ~TorcBinaryPListSerialiser() = default;
15 
16  HTTPResponseType ResponseType (void) override;
17 
18  protected:
19  void Prepare (QByteArray &) override;
20  void Begin (QByteArray &Dest) override;
21  void AddProperty (QByteArray &Dest, const QString &Name, const QVariant &Value) override;
22  void End (QByteArray &Dest) override;
23 
24  private:
25  quint64 BinaryFromVariant (QByteArray &Dest, const QString &Name, const QVariant &Value);
26  quint64 BinaryFromStringList (QByteArray &Dest, const QString &Name, const QStringList &Value);
27  quint64 BinaryFromArray (QByteArray &Dest, const QString &Name, const QVariantList &Value);
28  quint64 BinaryFromMap (QByteArray &Dest, const QString &Name, const QVariantMap &Value);
29  quint64 BinaryFromQString (QByteArray &Dest, const QString &Value);
30  void BinaryFromUInt (QByteArray &Dest, quint64 Value);
31  void BinaryFromUuid (QByteArray &Dest, const QVariant &Value);
32  void BinaryFromData (QByteArray &Dest, const QVariant &Value);
33  void CountObjects (quint64 &Count, const QVariant &Value);
34 
35  private:
36  quint8 m_referenceSize;
37  QList<quint64> m_objectOffsets;
38  QHash<QString,quint64> m_strings;
39 };
40 
41 #endif // TORCBINARYPLISTSERIALISER_H
void Begin(QByteArray &Dest) override
void Prepare(QByteArray &) override
void AddProperty(QByteArray &Dest, const QString &Name, const QVariant &Value) override
void End(QByteArray &Dest) override
HTTPResponseType
virtual ~TorcBinaryPListSerialiser()=default
HTTPResponseType ResponseType(void) override
Data serialiser for the Apple binary property list format.