Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

corona::File Class Reference

#include <corona.h>

Inheritance diagram for corona::File:

Inheritance graph
[legend]
Collaboration diagram for corona::File:

Collaboration graph
[legend]
List of all members.

Public Types

enum  SeekMode { BEGIN, CURRENT, END }

Public Methods

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

Detailed Description

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.

Definition at line 224 of file corona.h.


Member Enumeration Documentation

enum corona::File::SeekMode
 

The different ways you can seek within a file.

Enumeration values:
BEGIN  relative to the beginning of the file
CURRENT  relative to the current position in the file
END  relative to the end of the file: position should be negative

Definition at line 230 of file corona.h.

Referenced by corona::CFile::seek().


Member Function Documentation

virtual int COR_CALL corona::File::read void *    buffer,
int    size
[pure virtual]
 

Read size bytes from the file, storing them in buffer.

Parameters:
buffer buffer to read into
size number of bytes to read
Returns:
number of bytes successfully read

Implemented in corona::CFile, and corona::MemoryFile.

Referenced by corona::DecodeBitmap(), corona::InputFunc(), corona::JPEG_fill_input_buffer(), corona::OpenPCX(), corona::OpenPNG(), corona::OpenTGA(), corona::PNG_read_function(), corona::ReadHeader(), corona::ReadInfoHeader(), corona::ReadPalette(), and corona::ReadScanline().

virtual int COR_CALL corona::File::write const void *    buffer,
int    size
[pure virtual]
 

Write size bytes from buffer to the file.

Parameters:
buffer buffer that contains the data to write
size number of bytes to write
Returns:
number of bytes successfully written

Implemented in corona::CFile, and corona::MemoryFile.

Referenced by corona::PNG_write(), and corona::SaveTGA().

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.

Parameters:
position position relative to the mode
mode where to seek from in the file
Returns:
true on success, false otherwise

Implemented in corona::CFile, and corona::MemoryFile.

Referenced by corona::DecodeBitmap(), corona::OpenPCX(), and corona::ReadInfoHeader().

virtual int COR_CALL corona::File::tell   [pure virtual]
 

Get current position within the file.

Returns:
current position

Implemented in corona::CFile, and corona::MemoryFile.


The documentation for this class was generated from the following file:
Generated on Thu Oct 2 13:00:13 2003 for corona by doxygen1.3-rc1