#include <FileInterface.h>


Public Member Functions | |
| virtual FileHandle | Open (const String &path)=0 |
| virtual void | Close (FileHandle file)=0 |
| virtual size_t | Read (void *buffer, size_t size, FileHandle file)=0 |
| virtual bool | Seek (FileHandle file, long offset, int origin)=0 |
| virtual size_t | Tell (FileHandle file)=0 |
| virtual void | Release () |
| Called when this file interface is released. | |
Protected Member Functions | |
| virtual void | OnReferenceDeactivate () |
| A hook method called when the reference count drops to 0. | |
By default, Rocket will use a file interface implementing the standard C file functions. If this is not sufficient, or your application wants more control over file I/O, this class should be derived, instanced, and installed through Core::SetFileInterface() before you initialise Rocket.
| virtual FileHandle Rocket::Core::FileInterface::Open | ( | const String & | path | ) | [pure virtual] |
Opens a file.
| file | The file handle to write to. |
Implemented in Rocket::Core::FileInterfaceDefault.
| virtual void Rocket::Core::FileInterface::Close | ( | FileHandle | file | ) | [pure virtual] |
Closes a previously opened file.
| file | The file handle previously opened through Open(). |
Implemented in Rocket::Core::FileInterfaceDefault.
| virtual size_t Rocket::Core::FileInterface::Read | ( | void * | buffer, | |
| size_t | size, | |||
| FileHandle | file | |||
| ) | [pure virtual] |
Reads data from a previously opened file.
| buffer | The buffer to be read into. | |
| size | The number of bytes to read into the buffer. | |
| file | The handle of the file. |
Implemented in Rocket::Core::FileInterfaceDefault.
| virtual bool Rocket::Core::FileInterface::Seek | ( | FileHandle | file, | |
| long | offset, | |||
| int | origin | |||
| ) | [pure virtual] |
Seeks to a point in a previously opened file.
| file | The handle of the file to seek. | |
| offset | The number of bytes to seek. | |
| origin | One of either SEEK_SET (seek from the beginning of the file), SEEK_END (seek from the end of the file) or SEEK_CUR (seek from the current file position). |
Implemented in Rocket::Core::FileInterfaceDefault.
| virtual size_t Rocket::Core::FileInterface::Tell | ( | FileHandle | file | ) | [pure virtual] |
Returns the current position of the file pointer.
| file | The handle of the file to be queried. |
Implemented in Rocket::Core::FileInterfaceDefault.