The Fast Light Environment Kit



class FFile

Include Files

#include <Flek/FFile.H>

Description

fFile provides efficient file io routines in a c++ encapsulation. On most systems it should perform better than c++ io streams. Ultimately, this class should be similar to Ruby's File Class.

Methods


Method Descriptions

FFile

FFile::FFile(char *filename=0, FFileMode mode=FFileRead);

The Constructor.

Parameters
filenameThe name of the file to open.
modeThe mode the file should be opened in:
  • FFileRead - Open text file for reading. The stream is positioned at the beginning of the file.
  • FFileReadPlus - Open for reading and writing. The stream is positioned at the beginning of the file.
  • FFileWrite - Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file.
  • FFileWritePlus - Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file.
  • FFileAppend - Open for writing. The file is created if it does not exist. The stream is positioned at the end of the file.
  • FFileAppendPlus - Open for reading and writing. The file is created if it does not exist. The stream is positioned at the end of the file.
  • *

bad

bool FFile::bad();

Report if there has been any errors.

close

void FFile::close();

Close the file stream.

fd

FILE *FFile::fd();

Return the C file handle.

get_hi

void FFile::get_hi(uchar& r);

Get a single unsigned character from the file stream using Hi (MSB) byte order.

void FFile::get_hi(short& r);

Get a single short int from the file stream using Hi (MSB) byte order.

void FFile::get_hi(ushort& r);

Get a single unsigned short int from the file stream using Hi (MSB) byte order.

void FFile::get_hi(ulong& r);

Get a single unsigned long int from the file stream using Hi (MSB) byte order.

open

void FFile::open(char *filename, FFileMode mode);

Open a file with the given filename, and a mode. The mode should be one of the standard fopen modes (see the constructor for a listing).

put_hi

inline void FFile::put_hi(char c);

Put a single character into the file stream using Hi (MSB) byte order.

inline void FFile::put_hi(uchar c);

Put a single unsigned character into the file stream using Hi (MSB) byte order.

inline void FFile::put_hi(unsigned short c);

Put a single unsigned short into the file stream using Hi (MSB) byte order.

inline void FFile::put_hi(short c);

Put a single unsigned short into the file stream using Hi (MSB) byte order.

inline void FFile::put_hi(unsigned long c);

Put a single unsigned long into the file stream using Hi (MSB) byte order.

inline void FFile::put_hi(long c);

Put a single long into the file stream using Hi (MSB) byte order.

read

inline void FFile::read(char *c, int len);

Read an array of characters into the file stream.

inline void FFile::read(uchar *c, int len);

Read an array of unsigned characters into the file stream.

seek

inline void FFile::seek(long pos, int mode = SEEK_SET);

Set the file postion indicator to pos. Seek can set pos relative to the beginning (mode=SEEK_SET), the end (mode=SEEK_END), or the current position (mode=SEEK_CUR).

tell

long FFile::tell();

Report the current file position.

write

inline void FFile::write(char *c, int len);

Write an array of characters into the file stream.

~FFile

FFile::~FFile();

The destructor closes the file if it is still open.

© 2000 the Flek Development team.
Generated by ScanDoc
Last Updated: Tue May 15 8:50:06 2001