aboutsummaryrefslogtreecommitdiff
path: root/bitreader.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-06-07 21:22:45 +0200
committerJavier <dev.git@javispedro.com>2015-06-07 21:22:45 +0200
commita69e97943539a8abc4d2762638c169dc19c88516 (patch)
treef3516ea29745db65971247cee4c260b49f1067b2 /bitreader.h
downloadscribiu-a69e97943539a8abc4d2762638c169dc19c88516.tar.gz
scribiu-a69e97943539a8abc4d2762638c169dc19c88516.zip
initial import
Diffstat (limited to 'bitreader.h')
-rw-r--r--bitreader.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/bitreader.h b/bitreader.h
new file mode 100644
index 0000000..c4b9207
--- /dev/null
+++ b/bitreader.h
@@ -0,0 +1,25 @@
+#ifndef BITREADER_H
+#define BITREADER_H
+
+#include <QtCore/QIODevice>
+
+class BitReader
+{
+public:
+ BitReader(QIODevice * device);
+ ~BitReader();
+
+ quint64 readBits(int n);
+ quint64 peekBits(int n);
+
+ void skipUntilNextByte();
+
+ bool atEnd();
+
+private:
+ QIODevice *child;
+ quint64 buf;
+ int avail;
+};
+
+#endif // BITREADER_H