corona
1.0.2
|
#include <corona.h>
Public Types | |
enum | SeekMode { BEGIN, CURRENT, END } |
Public Member Functions | |
virtual int COR_CALL | read (void *buffer, int size)=0 |
virtual int COR_CALL | write (const void *buffer, int size)=0 |
virtual bool COR_CALL | seek (int position, SeekMode mode)=0 |
virtual int COR_CALL | tell ()=0 |
Represents a random-access file, usually stored on a disk. Files are always binary: that is, they do no end-of-line transformations. File objects are roughly analogous to ANSI C FILE* objects.
virtual int COR_CALL corona::File::read | ( | void * | buffer, |
int | size | ||
) | [pure virtual] |
Read size bytes from the file, storing them in buffer.
buffer | buffer to read into |
size | number of bytes to read |
Implemented in corona::CFile, and corona::MemoryFile.
virtual int COR_CALL corona::File::write | ( | const void * | buffer, |
int | size | ||
) | [pure virtual] |
Write size bytes from buffer to the file.
buffer | buffer that contains the data to write |
size | number of bytes to write |
Implemented in corona::CFile, and corona::MemoryFile.
virtual bool COR_CALL corona::File::seek | ( | int | position, |
SeekMode | mode | ||
) | [pure virtual] |
Jump to a new position in the file, using the specified seek mode. Remember: if mode is END, the position must be negative, to seek backwards from the end of the file into its contents. If the seek fails, the current position is undefined.
position | position relative to the mode |
mode | where to seek from in the file |
Implemented in corona::CFile, and corona::MemoryFile.
virtual int COR_CALL corona::File::tell | ( | ) | [pure virtual] |
Get current position within the file.
Implemented in corona::CFile, and corona::MemoryFile.