diff options
author | Treeki <treeki@gmail.com> | 2013-12-25 09:00:59 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2013-12-25 09:00:59 +0100 |
commit | b7a8b597b00eedde277836eb8530ba742edcad5d (patch) | |
tree | 1b959fa0eec02ff4e22e168aa4379b2b64575ce3 /server/packetreader.h | |
download | bounce_qt-b7a8b597b00eedde277836eb8530ba742edcad5d.tar.gz bounce_qt-b7a8b597b00eedde277836eb8530ba742edcad5d.zip |
Diffstat (limited to '')
-rw-r--r-- | server/packetreader.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/server/packetreader.h b/server/packetreader.h new file mode 100644 index 0000000..676981d --- /dev/null +++ b/server/packetreader.h @@ -0,0 +1,21 @@ +#ifndef PACKETREADER_H +#define PACKETREADER_H + +#include <QString> +#include <QByteArray> + +class PacketReader { +public: + PacketReader(const QByteArray &buffer); + PacketReader(const quint8 *data, int size); + + quint32 readU32(); + bool readBytes(quint8 *output, int size); + QString readString(int maxSize); + +private: + const quint8 *m_pointer; + const quint8 *m_end; +}; + +#endif // PACKETREADER_H |