HOME | DOWNLOAD | DOCS | DEVELOPMENT | LICENSE | CREDITS |
Memory stream. More...
#include <iDataStream.h>
Public Member Functions | |
iMemoryStream () | |
Default constructor. | |
iMemoryStream (void *bdata, long bsize) | |
Convenience constructor. | |
~iMemoryStream () | |
Destructor. | |
void | deleteOnClose (bool del) |
Sets whether or not the memory buffer should be deleted when the stream is closed. | |
bool | open (void *bdata, long bsize) |
Opens a memory buffer. | |
bool | close () |
Disassociate the memory buffer from this stream. | |
long | read (void *bdata, long size, long count) |
Reads data from the stream. | |
long | write (const void *bdata, long size, long count) |
Writes data to the stream. | |
int | getc () |
Reads a character from the stream. | |
int | putc (int chr) |
Writes a character to the stream. | |
bool | flush () |
Flushes the stream. | |
long | size () const |
Returns the size of the stream. | |
long | tell () const |
Returns the current value of the stream's position indicator. | |
bool | seek (long offset, iDataSeek origin) |
Sets the position of the stream's position indicator. | |
bool | atEnd () const |
Checks if the end of the stream has been reached. |
Memory stream.
imagen::iMemoryStream::iMemoryStream | ( | ) | [inline] |
Default constructor.
imagen::iMemoryStream::iMemoryStream | ( | void * | bdata, |
long | bsize | ||
) |
Destructor.
void imagen::iMemoryStream::deleteOnClose | ( | bool | del | ) | [inline] |
Sets whether or not the memory buffer should be deleted when the stream is closed.
By default, the buffer is not deleted.
del | : True to delete the buffer, else false. |
bool imagen::iMemoryStream::open | ( | void * | bdata, |
long | bsize | ||
) |
Opens a memory buffer.
bdata | : The stream to open. |
bsize | : The size of the stream. |
bool imagen::iMemoryStream::close | ( | ) | [virtual] |
Disassociate the memory buffer from this stream.
Even though the stream is closed on destruction, it's still good practice to call this function when you're done with the stream.
Implements imagen::iDataStream.
long imagen::iMemoryStream::read | ( | void * | data, |
long | size, | ||
long | count | ||
) | [virtual] |
Reads data from the stream.
data | : The array to place the read data into. |
size | : The size in bytes of each element to read. |
count | : The number of elements to read. |
Implements imagen::iDataStream.
long imagen::iMemoryStream::write | ( | const void * | data, |
long | size, | ||
long | count | ||
) | [virtual] |
Writes data to the stream.
data | : The array of data to write. |
size | : The size in bytes of each element to write. |
count | : The number of elements to write. |
Implements imagen::iDataStream.
int imagen::iMemoryStream::getc | ( | ) | [virtual] |
Reads a character from the stream.
Implements imagen::iDataStream.
int imagen::iMemoryStream::putc | ( | int | chr | ) | [virtual] |
Writes a character to the stream.
Implements imagen::iDataStream.
bool imagen::iMemoryStream::flush | ( | ) | [virtual] |
Flushes the stream.
This function currently does nothing.
Implements imagen::iDataStream.
long imagen::iMemoryStream::size | ( | ) | const [inline, virtual] |
Returns the size of the stream.
Implements imagen::iDataStream.
long imagen::iMemoryStream::tell | ( | ) | const [inline, virtual] |
Returns the current value of the stream's position indicator.
Implements imagen::iDataStream.
bool imagen::iMemoryStream::seek | ( | long | offset, |
iDataSeek | origin | ||
) | [virtual] |
Sets the position of the stream's position indicator.
offset | : The new position relative to origin |
origin | : The reference position to add offset to. |
Implements imagen::iDataStream.
bool imagen::iMemoryStream::atEnd | ( | ) | const [virtual] |
Checks if the end of the stream has been reached.
Implements imagen::iDataStream.
API Documentation by Mark D. Procarione | Generated by |