CLucene - a full-featured, c++ search engine
API Documentation
#include <subinputstream.h>
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. |
jstreams::SubInputStream< T >::SubInputStream | ( | StreamBase< T > * | input, | |
int64_t | size = -1 | |||
) | [inline] |
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.
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. |
Implements jstreams::StreamBase< T >.
References jstreams::Eof, and jstreams::Error.
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.
int64_t jstreams::SubInputStream< T >::skip | ( | int64_t | ntoskip | ) | [inline, virtual] |
Skip.
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.