CLucene - a full-featured, c++ search engine
API Documentation


jstreams::SubInputStream< T > Class Template Reference

#include <subinputstream.h>

Inheritance diagram for jstreams::SubInputStream< T >:

jstreams::StreamBase< T >

Public Member Functions

 SubInputStream (StreamBase< T > *input, int64_t size=-1)
int32_t read (const T *&start, int32_t min, int32_t max)
 Reads characters from the stream and sets start to the first character that was read.
int64_t reset (int64_t newpos)
 Repositions this stream to given requested position.
int64_t skip (int64_t ntoskip)
 Skip.

template<class T>
class jstreams::SubInputStream< T >


Constructor & Destructor Documentation

template<class T>
jstreams::SubInputStream< T >::SubInputStream ( StreamBase< T > *  input,
int64_t  size = -1 
) [inline]


Member Function Documentation

template<class T>
int32_t jstreams::SubInputStream< T >::read ( const T *&  start,
int32_t  min,
int32_t  max 
) [inline, virtual]

Reads characters from the stream and sets start to the first character that was read.

If ntoread is 0, then at least one character will be read.

Parameters:
start Pointer passed by reference that will be set to point to the retrieved array of characters. If the end of the stream is encountered or an error occurs, the value of start is undefined.
min The number of characters to read from the stream.
max The maximum number of characters to read from the stream.
Returns:
the number of characters that were read. If -1 is returned, the end of the stream has been reached. If -2 is returned, an error has occurred.

Implements jstreams::StreamBase< T >.

References jstreams::Eof, and jstreams::Error.

template<class T>
int64_t jstreams::SubInputStream< T >::reset ( int64_t  pos  )  [inline, virtual]

Repositions this stream to given requested position.

Reset is guaranteed to work after a successful call to read(), when the new position is in the range of the data returned by read(). This means that pos must lie between than the position corresponding to the start parameter (x) of the read function and the position corresponding to the last position in the returned buffer (x + nread).

Implements jstreams::StreamBase< T >.

References jstreams::Error.

template<class T>
int64_t jstreams::SubInputStream< T >::skip ( int64_t  ntoskip  )  [inline, virtual]

Skip.

Parameters:
ntoskip bytes. Unless an error occurs or the end of file is encountered, this amount of bytes is skipped. This function returns new position in the stream.

Reimplemented from jstreams::StreamBase< T >.

References jstreams::Eof, and jstreams::Error.


The documentation for this class was generated from the following file:

clucene.sourceforge.net