ZStreamRPos Class Reference
[Streams]

Base interface for positionable read streams. More...

#include <ZStream.h>

Inheritance diagram for ZStreamRPos:

ZStreamU ZStreamR ZStreamRPos_Limited ZStreamRPos_Memory ZStreamRPos_Null ZStreamRPos_PageBuffered ZStreamRPos_StreamR ZStreamRPos_String ZStreamRWPos ZStreamRWPos_PageBuffered ZStreamRWPos_RAM ZStreamRWPos_String List of all members.

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

Detailed Description

Base interface for positionable read streams.

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.


Member Function Documentation

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.

void ZStreamRPos::Imp_Skip ( uint64  iCount,
uint64 oCountSkipped 
) [virtual]

Read and discard iCount bytes.

Override this method if your stream implementation can skip past bytes in the stream without actually reading them.

Parameters:
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.


The documentation for this class was generated from the following files:
Generated on Thu Jul 26 11:22:03 2007 for ZooLib by  doxygen 1.4.7