summaryrefslogtreecommitdiff
path: root/server/packetreader.h
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-12-25 09:00:59 +0100
committerTreeki <treeki@gmail.com>2013-12-25 09:00:59 +0100
commitb7a8b597b00eedde277836eb8530ba742edcad5d (patch)
tree1b959fa0eec02ff4e22e168aa4379b2b64575ce3 /server/packetreader.h
downloadbounce_qt-b7a8b597b00eedde277836eb8530ba742edcad5d.tar.gz
bounce_qt-b7a8b597b00eedde277836eb8530ba742edcad5d.zip
commit initial bitsHEADmaster
Diffstat (limited to '')
-rw-r--r--server/packetreader.h21
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