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


jstreams::StringReader< T > Class Template Reference

#include <stringreader.h>

Inheritance diagram for jstreams::StringReader< T >:

jstreams::StreamBase< T >

Public Member Functions

 StringReader (const T *value, int32_t length=-1, bool copy=true)
 ~StringReader ()
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 skip (int64_t ntoskip)
 Skip.
int64_t reset (int64_t pos)
 Repositions this stream to given requested position.

template<class T>
class jstreams::StringReader< T >


Constructor & Destructor Documentation

template<class T>
jstreams::StringReader< T >::StringReader ( const T *  value,
int32_t  length = -1,
bool  copy = true 
) [inline]

template<class T>
jstreams::StringReader< T >::~StringReader (  )  [inline]


Member Function Documentation

template<class T>
int32_t jstreams::StringReader< 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.

Referenced by jstreams::StringReader< T >::skip().

template<class T>
int64_t jstreams::StringReader< 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::StringReader< T >::read().

template<class T>
int64_t jstreams::StringReader< 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::Eof, and jstreams::Ok.


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

clucene.sourceforge.net