diff --git a/include/ki/util/BitStream.h b/include/ki/util/BitStream.h index 709a30c..e5388f1 100644 --- a/include/ki/util/BitStream.h +++ b/include/ki/util/BitStream.h @@ -7,11 +7,10 @@ namespace ki { /** - * + * A readable/writeable stream of bits. */ class BitStream { - public: /** * Represents a position in a BitStream's buffer. @@ -34,6 +33,8 @@ namespace ki stream_pos &operator -=(int bits); stream_pos &operator ++(); stream_pos &operator --(); + stream_pos operator ++(int increment); + stream_pos operator --(int increment); private: intmax_t m_byte; diff --git a/src/util/BitStream.cpp b/src/util/BitStream.cpp index d368498..5f4284e 100644 --- a/src/util/BitStream.cpp +++ b/src/util/BitStream.cpp @@ -118,6 +118,20 @@ namespace ki return *this; } + BitStream::stream_pos BitStream::stream_pos::operator++(int increment) + { + auto copy(*this); + ++(*this); + return copy; + } + + BitStream::stream_pos BitStream::stream_pos::operator--(int increment) + { + auto copy(*this); + --(*this); + return copy; + } + BitStream::BitStream(const size_t buffer_size) { m_buffer = new uint8_t[buffer_size] { 0 };