#ifndef XDATASTREAM_H
#define XDATASTREAM_H

#include <QDataStream>
#include <QString>

class XDataStream : public QDataStream
{
public:
    explicit XDataStream(QIODevice* aDevice);
    XDataStream();
    XDataStream(const QByteArray& aData);
    XDataStream(QByteArray* aData, OpenMode aFlags);
    ~XDataStream();

    void SetDebug(bool aDebug = true);

    qint8 ParseInt8(const QString& aDebugString = "");
    quint8 ParseUInt8(const QString& aDebugString = "");
    qint16 ParseInt16(const QString& aDebugString = "");
    quint16 ParseUInt16(const QString& aDebugString = "");
    qint32 ParseInt32(const QString& aDebugString = "");
    quint32 ParseUInt32(const QString& aDebugString = "");
    qint64 ParseInt64(const QString& aDebugString = "");
    quint64 ParseUInt64(const QString& aDebugString = "");
    float ParseSingle(const QString& aDebugString = "");
    double ParseDouble(const QString& aDebugString = "");

private:
    bool mDebug;
};

#endif // XDATASTREAM_H
