This class implements a scoped input bitstream that allows to read content from a bitstream while the stream position is restored if this object is disposed.
More...
#include <Bitstream.h>
|
| | ScopedInputBitstream (InputBitstream &stream) |
| | Creates a new scoped input bitstream object from a given input bitstream object and stores the current stream position of the given stream object.
|
| |
| | ~ScopedInputBitstream () |
| | Destructs this scoped object and restores the stream position of the original input bitstream object.
|
| |
| | InputBitstream (std::istream &stream) |
| | Creates a new bitstream object.
|
| |
| template<typename T > |
| bool | read (T &value) |
| | Reads a value from the bitstream and moves the internal position inside the bitstream accordingly.
|
| |
| template<typename T > |
| T | readDefault (const T &defaultValue) |
| | Reads a value from the bitstream and moves the internal position inside the bitstream accordingly.
|
| |
| bool | read (void *data, const size_t size) |
| | Reads a defined memory block from the stream into a given buffer and moves the internal position inside the bitstream accordingly.
|
| |
| template<typename T > |
| bool | look (T &value) |
| | Reads a value from the bitstream but does not move the internal position inside the bitstream.
|
| |
| unsigned long long | position () const |
| | Returns the current position inside the bitstream, in bytes counting from the beginning of the stream.
|
| |
| unsigned long long | size () const |
| | Returns the current size of the bitstream, in bytes.
|
| |
| bool | setPosition (const unsigned long long position) |
| | Sets the current position inside the bitstream explicitly.
|
| |
| | operator bool () const |
| | Returns whether this bitstream object is valid and can be used.
|
| |
|
| unsigned long long | streamStartPosition_ |
| | The original stream position of the original bitstream object.
|
| |
| std::istream & | inputStream |
| | The internal input stream object that this object encapsulates.
|
| |
This class implements a scoped input bitstream that allows to read content from a bitstream while the stream position is restored if this object is disposed.
The implementation of this scoped input bitstream object is not thread-safe.
- See also
- InputBitstream
◆ ScopedInputBitstream()
| Ocean::IO::ScopedInputBitstream::ScopedInputBitstream |
( |
InputBitstream & |
stream | ) |
|
|
inline |
Creates a new scoped input bitstream object from a given input bitstream object and stores the current stream position of the given stream object.
◆ ~ScopedInputBitstream()
| Ocean::IO::ScopedInputBitstream::~ScopedInputBitstream |
( |
| ) |
|
|
inline |
Destructs this scoped object and restores the stream position of the original input bitstream object.
◆ streamStartPosition_
| unsigned long long Ocean::IO::ScopedInputBitstream::streamStartPosition_ |
|
protected |
The original stream position of the original bitstream object.
The documentation for this class was generated from the following file: