Photon 0.0.2 Simple Open Source 2D Game API |
FileBufferClass for reading data from a file, uses PhysFS http://physfs.icculus.org and is capable of reading from archives on the search path. Summary
FileBuffer
Initializing constructor, calls open. Parameters
~FileBuffer
Destructor, calls close. getData
Loads an amount of data, returns a pointer to the loaded data. If the requested amount of data wasn’t available, returns only what could be loaded. If amount is 0 (default), returns entire buffer. Parameters
ReturnsVector containing loaded data, empty if nothing loaded. |
Initializes empty buffer.
FileBuffer()
Loads a file into the FileBuffer.
void open( const std:: string & filename )
Destructor, calls close.
~FileBuffer()
Frees memory occupied by loaded data.
void close()
Loads an amount of data, returns a pointer to the loaded data.
std::vector<ubyte> getData( int amount = )
Gets position of internal cursor inside data.
uint getPosition() const
Gets size of data.
uint getSize() const
Checks if internal cursor is at end of file.
bool isEOF() const
Checks if file is open.
bool isOpen() const