cAudio::cMemorySource Class Reference

Class used to read from a memory buffer. More...

#include <cMemorySource.h>

Inheritance diagram for cAudio::cMemorySource:
Inheritance graph
[legend]
Collaboration diagram for cAudio::cMemorySource:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Class used to read from a memory buffer.

Definition at line 14 of file cMemorySource.h.


Constructor & Destructor Documentation

cAudio::cMemorySource::cMemorySource ( const void *  data,
int  size,
bool  copy 
)

Default Constructor

Parameters:
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.


Member Function Documentation

bool cAudio::cMemorySource::isValid (  )  [virtual]

Returns whether the source is valid.

Returns:
Returns false in case of an error, like the file couldn't be found.

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.

Parameters:
output,: Pointer to a location to put the read data.
size,: Size in bytes of the data to read.
Returns:
Number of bytes actually read. 0 bytes may indicate end of file or stream.

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.

Parameters:
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.
Returns:
True if seek was successful, false if not.

Implements cAudio::IDataSource.

Definition at line 78 of file cMemorySource.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations

Generated on Sat Feb 20 22:55:35 2010 for cAudio by  doxygen 1.6.2