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

salt::StdFile Class Reference

StdFile implements the WFile interface using the standard file system. More...

#include <fileclasses.h>

Inheritance diagram for salt::StdFile:

Inheritance graph
[legend]
Collaboration diagram for salt::StdFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 StdFile (FILE *f)
 StdFile (const char *fn=NULL, char *mode="rb")
virtual ~StdFile ()
bool Open (const char *fn=NULL, char *mode="rb")
 opens the file fn in the specified mode.
void Close ()
 closes a previously opened file
void Destroy ()
 releases any occupied ressources used by the file.
int Eof ()
 returns a non zero value if the file pointer is at the end of the file
long Tell ()
 returns the current file pointer position
int GetPos (long *pos)
 copies the current file pointer position to pos and returns true on success
int Seek (long offset, int origin)
 sets the file pointer for the file.
void Rewind ()
 sets the file pointer to the beginning of the file
long Size ()
 return the size of the file
char * Gets (char *buffer, int n)
 reads in at most one less than n characters from the file and stores them into buffer.
int Getc ()
 reads the next character from the file returns it as an int r EOF on end of file or error.
int Puts (const char *s)
 writes a string without the trailing ''
int Putc (int c)
 writes a single character
size_t Read (void *buffer, size_t size, size_t count)
 reads reads count elements of data, each size bytes long, storing them in the specified buffer
size_t Read (void *buffer, size_t count)
 reads count bytes of data, storing them in the specified buffer
size_t Write (void *buffer, size_t size, size_t count)
 writes count elements of data from buffer, each size bytes long
size_t Write (void *buffer, size_t count)
 writes count bytes of data from buffer
void * GetHandle ()
 returns a handle identifying the file.

Protected Attributes

FILE * mHandle
 the standard file handle

Detailed Description

StdFile implements the WFile interface using the standard file system.

Definition at line 299 of file fileclasses.h.


Constructor & Destructor Documentation

StdFile::StdFile FILE *  f  ) 
 

Definition at line 229 of file fileclasses.cpp.

References Destroy(), and mHandle.

Here is the call graph for this function:

StdFile::StdFile const char *  fn = NULL,
char *  mode = "rb"
 

Definition at line 237 of file fileclasses.cpp.

References mHandle, and Open().

Here is the call graph for this function:

StdFile::~StdFile  )  [virtual]
 

Definition at line 244 of file fileclasses.cpp.

References Destroy().

Here is the call graph for this function:


Member Function Documentation

void StdFile::Close  )  [virtual]
 

closes a previously opened file

Implements salt::RFile.

Definition at line 256 of file fileclasses.cpp.

References mHandle.

Referenced by Destroy().

void StdFile::Destroy  )  [virtual]
 

releases any occupied ressources used by the file.

The semantic is up to the derived classes

Implements salt::RFile.

Definition at line 250 of file fileclasses.cpp.

References Close().

Referenced by StdFile(), and ~StdFile().

Here is the call graph for this function:

int StdFile::Eof  )  [virtual]
 

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

Implements salt::RFile.

Definition at line 280 of file fileclasses.cpp.

References mHandle.

int StdFile::Getc  )  [virtual]
 

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

Implements salt::RFile.

Definition at line 314 of file fileclasses.cpp.

References mHandle.

void * StdFile::GetHandle  )  [virtual]
 

returns a handle identifying the file.

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

Implements salt::RFile.

Definition at line 344 of file fileclasses.cpp.

References mHandle.

Referenced by salt::MemFile::Open().

int StdFile::GetPos long *  pos  )  [virtual]
 

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

Implements salt::RFile.

Definition at line 299 of file fileclasses.cpp.

References mHandle.

char * StdFile::Gets char *  buffer,
int  n
[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.

Implements salt::RFile.

Definition at line 309 of file fileclasses.cpp.

References mHandle.

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

opens the file fn in the specified mode.

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

Implements salt::RFile.

Definition at line 265 of file fileclasses.cpp.

References mHandle.

Referenced by StdFile().

int StdFile::Putc int  c  )  [virtual]
 

writes a single character

Implements salt::WFile.

Definition at line 324 of file fileclasses.cpp.

References mHandle.

int StdFile::Puts const char *  s  )  [virtual]
 

writes a string without the trailing ''

Implements salt::WFile.

Definition at line 319 of file fileclasses.cpp.

References mHandle.

size_t salt::StdFile::Read void *  buffer,
size_t  count
[inline, virtual]
 

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

Implements salt::RFile.

Definition at line 324 of file fileclasses.h.

References Read().

Here is the call graph for this function:

size_t StdFile::Read void *  buffer,
size_t  size,
size_t  count
[virtual]
 

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

Implements salt::RFile.

Definition at line 334 of file fileclasses.cpp.

References mHandle.

Referenced by salt::MemFile::Open(), and Read().

void StdFile::Rewind  )  [virtual]
 

sets the file pointer to the beginning of the file

Implements salt::RFile.

Definition at line 304 of file fileclasses.cpp.

References mHandle.

int StdFile::Seek long  offset,
int  origin
[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.

Implements salt::RFile.

Definition at line 329 of file fileclasses.cpp.

References mHandle.

long StdFile::Size  )  [virtual]
 

return the size of the file

Implements salt::RFile.

Definition at line 290 of file fileclasses.cpp.

References mHandle.

Referenced by salt::MemFile::Open().

long StdFile::Tell  )  [virtual]
 

returns the current file pointer position

Implements salt::RFile.

Definition at line 285 of file fileclasses.cpp.

References mHandle.

size_t salt::StdFile::Write void *  buffer,
size_t  count
[inline, virtual]
 

writes count bytes of data from buffer

Implements salt::WFile.

Definition at line 327 of file fileclasses.h.

References Write().

Here is the call graph for this function:

size_t StdFile::Write void *  buffer,
size_t  size,
size_t  count
[virtual]
 

writes count elements of data from buffer, each size bytes long

Implements salt::WFile.

Definition at line 339 of file fileclasses.cpp.

References mHandle.

Referenced by Write().


Member Data Documentation

FILE* salt::StdFile::mHandle [protected]
 

the standard file handle

Definition at line 333 of file fileclasses.h.

Referenced by Close(), Eof(), Getc(), GetHandle(), GetPos(), Gets(), Open(), Putc(), Puts(), Read(), Rewind(), Seek(), Size(), StdFile(), Tell(), and Write().


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