diff options
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 |