Add XDataStream class for convenient data parsing.
This commit is contained in:
parent
a24fec5558
commit
bccbca87fa
33
libs/core/xdatastream.h
Normal file
33
libs/core/xdatastream.h
Normal file
@ -0,0 +1,33 @@
|
||||
#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
|
||||
Loading…
x
Reference in New Issue
Block a user