diff --git a/libs/core/xdatastream.h b/libs/core/xdatastream.h new file mode 100644 index 0000000..5cf9631 --- /dev/null +++ b/libs/core/xdatastream.h @@ -0,0 +1,33 @@ +#ifndef XDATASTREAM_H +#define XDATASTREAM_H + +#include +#include + +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