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.
|
| |
| uint64_t | position () const |
| | Returns the current position inside the bitstream, in bytes counting from the beginning of the stream.
|
| |
| uint64_t | size () const |
| | Returns the current size of the bitstream, in bytes.
|
| |
| bool | setPosition (const uint64_t position) |
| | Sets the current position inside the bitstream explicitly.
|
| |
| bool | skip (const uint64_t bytes) |
| | Skips a specified number of bytes in the bitstream by moving the position forward.
|
| |
| bool | isEndOfFile () const |
| | Returns whether the previous read attempt failed because the end of the stream has been reached.
|
| |
| bool | reset () |
| | Resets the stream after the stream has reached the end of the stream.
|
| |
| | operator bool () const |
| | Returns whether this bitstream object is valid and can be used.
|
| |
|
| uint64_t | streamStartPosition_ = uint64_t(-1) |
| | 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() [1/3]
| 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.
- Parameters
-
| stream | The input bitstream object that is encapsulated by this object |
◆ ~ScopedInputBitstream()
| Ocean::IO::ScopedInputBitstream::~ScopedInputBitstream |
( |
| ) |
|
|
inline |
Destructs this scoped object and restores the stream position of the original input bitstream object.
◆ ScopedInputBitstream() [2/3]
Deleted copy constructor.
◆ ScopedInputBitstream() [3/3]
Deleted move constructor.
◆ operator=() [1/2]
Deleted copy operator.
- Returns
- Reference to this object
◆ operator=() [2/2]
Deleted move operator.
- Returns
- Reference to this object
◆ streamStartPosition_
| uint64_t Ocean::IO::ScopedInputBitstream::streamStartPosition_ = uint64_t(-1) |
|
protected |
The original stream position of the original bitstream object.
The documentation for this class was generated from the following file: