![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/io/BufferedInStream.h>
Public Member Functions | |
BufferedInStream (InStream &input, int size=default_size) | |
BufferedInStream (InStream *input, bool close=false, int size=default_size) | |
~BufferedInStream () override | |
InStream & | stream () const |
void | setStream (InStream &str) |
void | reset () |
int | read (void *buffer, int size) override |
int | read (void) override |
![]() | |
virtual | ~InStream (void) |
virtual CString | lastErrorMessage (void) |
Static Public Attributes | |
static const int | default_size = 4096 |
![]() | |
static const int | FAILED = -1 |
static const int | ENDED = -2 |
static InStream & | null = _null |
Input stream providing bufferization for reading another stream.
BufferedInStream | ( | InStream & | input, |
int | size = default_size |
||
) |
BufferedInStream | ( | InStream * | input, |
bool | close = false , |
||
int | size = default_size |
||
) |
|
override |
|
overridevirtual |
Read some bytes from the stream and store them in the given buffer. This method does not ever read as many bytes as available in the buffer even if the stream is not ended. Insteadn a read returning 0 bytes means the end of stream is reached.
buffer | Buffer to write bytes in. |
size | Size of the buffer. |
Implements InStream.
|
overridevirtual |
Read one byte from the stream.
Reimplemented from InStream.
References InStream::ENDED, and InStream::FAILED.
void reset | ( | ) |
Reset the buffer to empty.
Referenced by BufferedInStream::setStream().
Set the current stream to read. The buffer is reset.
str | New stream. |
References BufferedInStream::reset(), and elm::str().
|
inline |
|
static |