MemoryStream Class Reference
A
Stream that operates on DataBlocks in memory.
More...
#include <yateclass.h>
List of all members.
Detailed Description
A
Stream that operates on DataBlocks in memory.
An implementation of a Stream that reads and writes data in a DataBlock
Constructor & Destructor Documentation
Constructor of an empty stream
Constructor of aan initialized stream
- Parameters:
-
| data | Initial data to be copied in the memory stream |
Member Function Documentation
virtual bool terminate |
( |
|
) |
[inline, virtual] |
Do-nothing termination handler
- Returns:
- True to signal the stream was closed
Implements Stream.
virtual bool valid |
( |
|
) |
const [inline, virtual] |
Do-nothing validity check
- Returns:
- True to indicate the stream is valid
Implements Stream.
virtual int writeData |
( |
const void * |
buffer, |
|
|
int |
len | |
|
) |
| | [virtual] |
Write new data to the DataBlock at current position, advance pointer
- Parameters:
-
| buffer | Buffer of source data |
| len | Length of data to be written |
- Returns:
- Number of bytes written, negative on error
Implements Stream.
virtual int readData |
( |
void * |
buffer, |
|
|
int |
len | |
|
) |
| | [virtual] |
Get data from internal DataBlock, advance pointer
- Parameters:
-
| buffer | Buffer for getting the data |
| len | Length of the buffer |
- Returns:
- Number of bytes read, negative on error, zero on end of data
Implements Stream.
virtual int64_t length |
( |
|
) |
[inline, virtual] |
Get the length of the stream
- Returns:
- Length of the DataBlock in memory
Reimplemented from Stream.
virtual int64_t seek |
( |
SeekPos |
pos, |
|
|
int64_t |
offset = 0 | |
|
) |
| | [virtual] |
Set the read/write pointer
- Parameters:
-
| pos | The seek start as enumeration |
| offset | The number of bytes to move the pointer from starting position |
- Returns:
- The new position of the stream read/write pointer. Negative on failure
Reimplemented from Stream.
Member Data Documentation
The current position for read/write operation
The documentation for this class was generated from the following file: