Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

salt::RFile Class Reference

RFile defines an interface and some basic support functions for classes providing read only file services. More...

#include <fileclasses.h>

Inheritance diagram for salt::RFile:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~RFile ()
virtual bool Open (const char *fn=NULL, char *mode="rb")=0
 opens the file fn in the specified mode.
virtual void Close ()=0
 closes a previously opened file
virtual void Destroy ()=0
 releases any occupied ressources used by the file.
virtual int Eof ()=0
 returns a non zero value if the file pointer is at the end of the file
virtual long Tell ()=0
 returns the current file pointer position
virtual int GetPos (long *pos)=0
 copies the current file pointer position to pos and returns true on success
virtual int Seek (long offset, int origin)=0
 sets the file pointer for the file.
virtual void Rewind ()=0
 sets the file pointer to the beginning of the file
virtual long Size ()=0
 return the size of the file
virtual char * Gets (char *buffer, int n)=0
 reads in at most one less than n characters from the file and stores them into buffer.
virtual int Getc ()=0
 reads the next character from the file returns it as an int r EOF on end of file or error.
virtual void * GetHandle ()=0
 returns a handle identifying the file.
virtual size_t Read (void *buffer, size_t size, size_t count)=0
 reads reads count elements of data, each size bytes long, storing them in the specified buffer
virtual size_t Read (void *buffer, size_t bytes)=0
 reads count bytes of data, storing them in the specified buffer
int Igetw ()
 reads a 2 byte int from the file in Intel ordering
long Igetl ()
 reads a 4 byte int from the file in Intel ordering
int Mgetw ()
 reads a 2 byte int from the file in Motorola ordering
long Mgetl ()
 reads a 4 byte int from the file in Motorola ordering

Detailed Description

RFile defines an interface and some basic support functions for classes providing read only file services.

Definition at line 47 of file fileclasses.h.


Constructor & Destructor Documentation

virtual salt::RFile::~RFile  )  [inline, virtual]
 

Definition at line 50 of file fileclasses.h.


Member Function Documentation

virtual void salt::RFile::Close  )  [pure virtual]
 

closes a previously opened file

Implemented in salt::MemFile, and salt::StdFile.

virtual void salt::RFile::Destroy  )  [pure virtual]
 

releases any occupied ressources used by the file.

The semantic is up to the derived classes

Implemented in salt::MemFile, and salt::StdFile.

virtual int salt::RFile::Eof  )  [pure virtual]
 

returns a non zero value if the file pointer is at the end of the file

Implemented in salt::MemFile, and salt::StdFile.

virtual int salt::RFile::Getc  )  [pure virtual]
 

reads the next character from the file returns it as an int r EOF on end of file or error.

Implemented in salt::MemFile, and salt::StdFile.

Referenced by Igetl(), Igetw(), Mgetl(), and Mgetw().

virtual void* salt::RFile::GetHandle  )  [pure virtual]
 

returns a handle identifying the file.

The semantics of this handle depends on the subclass, implementing this method

Implemented in salt::MemFile, and salt::StdFile.

virtual int salt::RFile::GetPos long *  pos  )  [pure virtual]
 

copies the current file pointer position to pos and returns true on success

Implemented in salt::MemFile, and salt::StdFile.

virtual char* salt::RFile::Gets char *  buffer,
int  n
[pure virtual]
 

reads in at most one less than n characters from the file and stores them into buffer.

A '' is stored after the last character in the buffer.

Implemented in salt::MemFile, and salt::StdFile.

long salt::RFile::Igetl  )  [inline]
 

reads a 4 byte int from the file in Intel ordering

Definition at line 130 of file fileclasses.h.

References Getc().

Here is the call graph for this function:

int salt::RFile::Igetw  )  [inline]
 

reads a 2 byte int from the file in Intel ordering

Definition at line 119 of file fileclasses.h.

References Getc().

Here is the call graph for this function:

long salt::RFile::Mgetl  )  [inline]
 

reads a 4 byte int from the file in Motorola ordering

Definition at line 154 of file fileclasses.h.

References Getc().

Here is the call graph for this function:

int salt::RFile::Mgetw  )  [inline]
 

reads a 2 byte int from the file in Motorola ordering

Definition at line 143 of file fileclasses.h.

References Getc().

Here is the call graph for this function:

virtual bool salt::RFile::Open const char *  fn = NULL,
char *  mode = "rb"
[pure virtual]
 

opens the file fn in the specified mode.

The implementation of the namespace and mode semantics ist up to derived classes

Implemented in salt::MemFile, and salt::StdFile.

virtual size_t salt::RFile::Read void *  buffer,
size_t  bytes
[pure virtual]
 

reads count bytes of data, storing them in the specified buffer

Implemented in salt::MemFile, and salt::StdFile.

virtual size_t salt::RFile::Read void *  buffer,
size_t  size,
size_t  count
[pure virtual]
 

reads reads count elements of data, each size bytes long, storing them in the specified buffer

Implemented in salt::MemFile, and salt::StdFile.

Referenced by kerosin::OpenGLServer::LoadARBProgram(), and salt::MemFile::MemFile().

virtual void salt::RFile::Rewind  )  [pure virtual]
 

sets the file pointer to the beginning of the file

Implemented in salt::MemFile, and salt::StdFile.

virtual int salt::RFile::Seek long  offset,
int  origin
[pure virtual]
 

sets the file pointer for the file.

The new position, measured in bytes, is obtained by adding offset bytes to the position specified by origin. If origin is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively.

Implemented in salt::MemFile, and salt::StdFile.

virtual long salt::RFile::Size  )  [pure virtual]
 

return the size of the file

Implemented in salt::MemFile, and salt::StdFile.

Referenced by kerosin::OpenGLServer::LoadARBProgram(), and salt::MemFile::MemFile().

virtual long salt::RFile::Tell  )  [pure virtual]
 

returns the current file pointer position

Implemented in salt::MemFile, and salt::StdFile.


The documentation for this class was generated from the following file:
Generated on Thu Apr 6 15:48:39 2006 for rcssserver3d by  doxygen 1.4.4