#include <ZStream.h>
Inheritance diagram for ZStreamRPos:
Public Member Functions | |
Implementation of optional ZStreamR method | |
virtual size_t | Imp_CountReadable () |
Returns the number of bytes guaranteed to be readable without blocking. | |
virtual void | Imp_Skip (uint64 iCount, uint64 *oCountSkipped) |
Read and discard iCount bytes. | |
Implementation of required ZStreamU method | |
Position and size API | |
uint64 | GetPosition () const |
void | SetPosition (uint64 iPosition) const |
uint64 | GetSize () const |
Essential overrides |
A ZStreamRPos augments ZStreamW with two attributes, an immutable size and a position. The position may take any value, but reads will only succeed when it is less then size. As data is read the position is updated by the number of bytes consumed.
size_t ZStreamRPos::Imp_CountReadable | ( | ) | [virtual] |
Returns the number of bytes guaranteed to be readable without blocking.
If the stream does not or cannot know this information it should return zero. A zero return thus does not mean no data is available, simply that a subsequent Read or Skip may block indefinitely.
Reimplemented from ZStreamR.
Reimplemented in ZStreamRPos_Memory, ZStreamRPos_PageBuffered, ZStreamRPos_StreamR, and ZStreamRWPos_RAM.
Read and discard iCount bytes.
Override this method if your stream implementation can skip past bytes in the stream without actually reading them.
iCount | Count of bytes to be skipped. | |
oCountSkipped | Number of bytes that were actually skipped. If iCount is non zero and oCountSkipped is set to zero then this indicates that the stream has reached its end. |
Reimplemented from ZStreamR.
Reimplemented in ZStreamRPos_Null, ZStreamRPos_Memory, ZStreamRPos_PageBuffered, and ZStreamRWPos_RAM.
uint64 ZStreamRPos::GetPosition | ( | ) | const [inline] |
Return the stream's current position.
Reimplemented in ZStreamRWPos.
void ZStreamRPos::SetPosition | ( | uint64 | iPosition | ) | const [inline] |
Set the stream's position.
Reimplemented in ZStreamRWPos.
uint64 ZStreamRPos::GetSize | ( | ) | const [inline] |
Return the stream's size.
Reimplemented in ZStreamRWPos.