2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-03 10:50:53 +00:00
qpdf/libqpdf/qpdf/BitStream.hh
Jay Berkenbilt 07edf96440 Remove methods of private classes from ABI
Prior to the cmake conversion, several private classes had methods
that were exported into the shared library so they could be tested
with libtests. With cmake, we build libtests using an object library,
so this is no longer necessary. The methods that are disappearing from
the ABI were never exposed through public headers, so no code should
be using them. Removal had to wait until the window for ABI-breaking
changes was open.
2022-04-09 17:33:29 -04:00

30 lines
648 B
C++

// Read bits from a bit stream. See BitWriter for writing.
#ifndef BITSTREAM_HH
#define BITSTREAM_HH
#include <stddef.h>
class BitStream
{
public:
BitStream(unsigned char const* p, size_t nbytes);
void reset();
unsigned long long getBits(size_t nbits);
long long getBitsSigned(size_t nbits);
// Only call getBitsInt when requesting a number of bits that will
// definitely fit in an int.
int getBitsInt(size_t nbits);
void skipToNextByte();
private:
unsigned char const* start;
size_t nbytes;
unsigned char const* p;
size_t bit_offset;
size_t bits_available;
};
#endif // BITSTREAM_HH