Class used to read from a memory buffer. More...
#include <cMemorySource.h>


Public Member Functions | |
| cMemorySource (const void *data, int size, bool copy) | |
| virtual bool | isValid () |
| Returns whether the source is valid. | |
| virtual int | getCurrentPos () |
| Returns the current location in the data stream. | |
| virtual int | getSize () |
| Returns the total size of the data stream. | |
| virtual int | read (void *output, int size) |
| Reads out a section of the data stream. | |
| virtual bool | seek (int amount, bool relative) |
| Seek to a position in the data stream. | |
Protected Attributes | |
| char * | Data |
| int | Size |
| bool | Valid |
| int | Pos |
Class used to read from a memory buffer.
Definition at line 14 of file cMemorySource.h.
| cAudio::cMemorySource::cMemorySource | ( | const void * | data, | |
| int | size, | |||
| bool | copy | |||
| ) |
Default Constructor
| data,: | Pointer to a data buffer to use. | |
| size,: | Size of the target buffer. | |
| copy,: | Whether to copy the buffer or use the provided pointer. On destruct, that pointer will be deleted unless copy is true. |
Definition at line 18 of file cMemorySource.cpp.
| bool cAudio::cMemorySource::isValid | ( | ) | [virtual] |
Returns whether the source is valid.
Implements cAudio::IDataSource.
Definition at line 43 of file cMemorySource.cpp.
| int cAudio::cMemorySource::read | ( | void * | output, | |
| int | size | |||
| ) | [virtual] |
Reads out a section of the data stream.
| output,: | Pointer to a location to put the read data. | |
| size,: | Size in bytes of the data to read. |
Implements cAudio::IDataSource.
Definition at line 58 of file cMemorySource.cpp.
| bool cAudio::cMemorySource::seek | ( | int | amount, | |
| bool | relative | |||
| ) | [virtual] |
Seek to a position in the data stream.
| amount,: | Amount in bytes to seek to. | |
| relative,: | If true the number of bytes in amount is relative to the current position in the stream. |
Implements cAudio::IDataSource.
Definition at line 78 of file cMemorySource.cpp.
1.6.2