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. More... | |
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. More... | |
virtual bool | seek (int amount, bool relative) |
Seek to a position in the data stream. More... | |
![]() | |
virtual void | grab () |
Increments the reference count by one. | |
virtual bool | drop () |
Decrements the reference count by one. If it hits zero, this object is deleted. | |
int | getReferenceCount () const |
Returns the current reference count of this object. | |
![]() | |
void * | operator new (size_t size, const char *file, int line, const char *function) |
void * | operator new (size_t size) |
void * | operator new (size_t size, void *pointer) |
void * | operator new[] (size_t size, const char *file, int line, const char *function) |
void * | operator new[] (size_t size) |
void | operator delete (void *pointer) |
void | operator delete (void *pointer, void *) |
void | operator delete (void *pointer, const char *, int, const char *) |
void | operator delete[] (void *pointer) |
void | operator delete[] (void *pointer, const char *, int, const char *) |
Protected Attributes | |
char * | Data |
int | Size |
bool | Valid |
int | Pos |
![]() | |
int | RefCount |
Class used to read from a memory buffer.
Definition at line 13 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 12 of file cMemorySource.cpp.
|
virtual |
Returns whether the source is valid.
Implements cAudio::IDataSource.
Definition at line 37 of file cMemorySource.cpp.
|
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 52 of file cMemorySource.cpp.
|
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 72 of file cMemorySource.cpp.