32 #ifndef SPL_bitStream_hpp 33 #define SPL_bitStream_hpp 39 #include <SPL/config.hpp> 86 typedef unsigned long long Size;
242 std::istream* getInput()
const;
247 void setInput(std::istream* in);
257 Offset getReadLimit()
const;
267 void setReadLimit(
Offset readLimit);
272 Size getReadCount()
const;
277 void clearReadCount();
290 long getBits(
int numBits);
312 void dump(std::ostream& out)
const;
356 readLimit_ = readLimit;
406 std::ostream* getOutput()
const;
412 void setOutput(std::ostream* out);
417 void clearWriteCount();
422 Size getWriteCount()
const;
432 void setWriteLimit(
Offset writeLimit);
442 Offset getWriteLimit()
const;
454 int putBits(
long data,
int numBits);
482 void dump(std::ostream& out)
const;
531 writeLimit_ = writeLimit;
void setIoStateBits(IoState state)
Set the specified bits in the I/O state of a bit stream.
Definition: bitStream.hpp:195
Size getWriteCount() const
Get the number of bits written to the bit stream.
Definition: bitStream.hpp:514
static const IoState eofBit
end of file (EOF) reached on input
Definition: bitStream.hpp:75
unsigned IoState
The type used for the error state for a stream.
Definition: bitStream.hpp:69
Definition: Arcball.hpp:48
void setWriteLimit(Offset writeLimit)
Set the number of bits that may still be written to the bit stream.
Definition: bitStream.hpp:529
Output bit stream class.
Definition: bitStream.hpp:372
static const IoState allIoBits
all error bits
Definition: bitStream.hpp:81
Offset getWriteLimit() const
Get the number of bits that may still be written to the underlying (character) stream.
Definition: bitStream.hpp:524
bool isEof() const
Test if the bitstream has encountered end-of-file (EOF).
Definition: bitStream.hpp:168
void clearIoStateBits(IoState state=allIoBits)
Clear the specified bits in the I/O state of a bit stream.
Definition: bitStream.hpp:189
IoState getIoState() const
Get the I/O state of a bit stream.
Definition: bitStream.hpp:184
static const IoState limitBit
read/write limit exceeded
Definition: bitStream.hpp:77
void clearReadCount()
Set the read count to zero.
Definition: bitStream.hpp:344
Offset getReadLimit() const
Get the number of bits that still may be read from the bit stream before the read limit is reached...
Definition: bitStream.hpp:359
A common base class for the input and output bit stream classes.
Definition: bitStream.hpp:61
Size getReadCount() const
Get the number of bits read from the bit stream so far.
Definition: bitStream.hpp:349
bool isOkay() const
Test if the bitstream in an okay (i.e., non-error) state.
Definition: bitStream.hpp:163
void setReadLimit(Offset readLimit)
Specify the maximum allowable number of bits that may be read from the bit stream.
Definition: bitStream.hpp:354
void setIoState(IoState state)
Set the I/O state of a bit stream.
Definition: bitStream.hpp:178
void clearWriteCount()
Clear the count of the number of bits written to the bit stream.
Definition: bitStream.hpp:519
unsigned long long Size
An unsigned integral type (used for sizes/counts).
Definition: bitStream.hpp:86
static const IoState badBit
I/O error.
Definition: bitStream.hpp:79
long long Offset
A signed integral type (used for differences).
Definition: bitStream.hpp:91
bool isLimit() const
Test if the bitstream has encountered a read/write limit.
Definition: bitStream.hpp:173