#include <elm/io/BlockInStream.h>
Input stream from a memory block.
elm::io::BlockInStream::BlockInStream |
( |
const void * |
block, |
|
|
int |
size |
|
) |
| |
Build a new memory block input stream.
- Parameters
-
block | Block to read from. |
size | Block size. |
elm::io::BlockInStream::BlockInStream |
( |
const char * |
str | ) |
|
Build a block input stream from a C string.
- Parameters
-
elm::io::BlockInStream::BlockInStream |
( |
const CString & |
str | ) |
|
Build a block input stream from a CString object.
- Parameters
-
elm::io::BlockInStream::BlockInStream |
( |
const String & |
str | ) |
|
Build a block input stream from a String object.
- Parameters
-
char * elm::io::BlockInStream::block |
( |
void |
| ) |
const |
Get the current memory block.
- Returns
- Memory block.
int elm::io::BlockInStream::mark |
( |
void |
| ) |
const |
Get the current offset in the memory block.
- Returns
- Current offset.
Referenced by move().
void elm::io::BlockInStream::move |
( |
int |
mark | ) |
|
Move the read position to the given mark.
- Parameters
-
mark | Position mark to move to. |
References mark().
void elm::io::BlockInStream::moveBackward |
( |
int |
size | ) |
|
Move backward in the stream.
- Parameters
-
size | Count of bytes to move backward to. |
References size().
void elm::io::BlockInStream::moveForward |
( |
int |
size | ) |
|
Move forward in the stream.
- Parameters
-
size | Count of bytes to move forward to. |
int elm::io::BlockInStream::read |
( |
void * |
buffer, |
|
|
int |
size |
|
) |
| |
|
virtual |
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.
- Parameters
-
buffer | Buffer to write bytes in. |
size | Size of the buffer. |
- Returns
- Number of read bytes, 0 for end of stream, -1 for an error.
Implements elm::io::InStream.
References size().
int elm::io::BlockInStream::read |
( |
void |
| ) |
|
|
virtual |
void elm::io::BlockInStream::reset |
( |
void |
| ) |
|
Reset the stream to the start.
int elm::io::BlockInStream::size |
( |
void |
| ) |
const |
Get the size of the current memory block.
- Returns
- Memory block size.
Referenced by moveBackward(), and read().
The documentation for this class was generated from the following files: