mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-24 23:58:35 +00:00
07edf96440
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.
30 lines
648 B
C++
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
|