Rocket::Core::FileInterfaceDefault Class Reference

#include <FileInterfaceDefault.h>

Inheritance diagram for Rocket::Core::FileInterfaceDefault:
Collaboration diagram for Rocket::Core::FileInterfaceDefault:

Public Member Functions

virtual FileHandle Open (const String &path)
virtual void Close (FileHandle file)
virtual size_t Read (void *buffer, size_t size, FileHandle file)
virtual bool Seek (FileHandle file, long offset, int origin)
virtual size_t Tell (FileHandle file)

Detailed Description

Implementation of the Rocket file interface using the Standard C file functions.

Author:
Peter Curry

Member Function Documentation

FileHandle Rocket::Core::FileInterfaceDefault::Open ( const String path  )  [virtual]

Opens a file.

Parameters:
path The path of the file to open.
Returns:
A valid file handle, or NULL on failure

Implements Rocket::Core::FileInterface.

void Rocket::Core::FileInterfaceDefault::Close ( FileHandle  file  )  [virtual]

Closes a previously opened file.

Parameters:
file The file handle previously opened through Open().

Implements Rocket::Core::FileInterface.

size_t Rocket::Core::FileInterfaceDefault::Read ( void *  buffer,
size_t  size,
FileHandle  file 
) [virtual]

Reads data from a previously opened file.

Parameters:
buffer The buffer to be read into.
size The number of bytes to read into the buffer.
file The handle of the file.
Returns:
The total number of bytes read into the buffer.

Implements Rocket::Core::FileInterface.

bool Rocket::Core::FileInterfaceDefault::Seek ( FileHandle  file,
long  offset,
int  origin 
) [virtual]

Seeks to a point in a previously opened file.

Parameters:
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).
Returns:
True if the operation completed successfully, false otherwise.

Implements Rocket::Core::FileInterface.

size_t Rocket::Core::FileInterfaceDefault::Tell ( FileHandle  file  )  [virtual]

Returns the current position of the file pointer.

Parameters:
file The handle of the file to be queried.
Returns:
The number of bytes from the origin of the file.

Implements Rocket::Core::FileInterface.


The documentation for this class was generated from the following files: