ZStreamR_Boundary Class Reference

A read filter stream that reads from another stream until a boundary sequence is encountered. More...

#include <ZStreamR_Boundary.h>

Inheritance diagram for ZStreamR_Boundary:

ZStreamR List of all members.

Public Member Functions

virtual size_t Imp_CountReadable ()
 Returns the number of bytes guaranteed to be readable without blocking.
bool HitBoundary () const
void Reset ()

Detailed Description

A read filter stream that reads from another stream until a boundary sequence is encountered.

We use Boyer-Moore to efficiently search for the boundary sequence in the source stream. However, instead of discarding data that fails to match it is returned as the result of calls to Imp_Read.


Member Function Documentation

size_t ZStreamR_Boundary::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.

bool ZStreamR_Boundary::HitBoundary (  )  const

This method distinguishes between a stream that's gone empty because the boundary was encountered and one that's gone empty because the source stream is empty.

void ZStreamR_Boundary::Reset (  ) 

After the boundary has been encountered the stream appears empty. Calling ZStreamR_Boundary::Reset will allow data to be read again until the next boundary or the real end of stream.


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