Public Member Functions | |
virtual XFCIMPORT INT32 | seek (INT32 aDisplacement, INT32 aMode) |
Seeks to a certain position in the file. | |
virtual XFCIMPORT INT32 | tell () |
Returns the file position. | |
virtual XFCIMPORT const CHAR * | getFilename () |
Returns pointer to the filename used to create this XFcFile object. | |
virtual XFCIMPORT INT32 | getChar () |
Gets one byte from file. Returns EOF if end of file. | |
virtual XFCIMPORT INT32 | putChar (INT32 aChar) |
Puts one byte in the file. | |
virtual XFCIMPORT INT32 | read (void *aBuf, INT32 aSize, INT32 aCount) |
Read chunk(s) from file at once. | |
virtual XFCIMPORT INT32 | write (const void *aBuf, INT32 aSize, INT32 aCount) |
Writes chunk(s) to file at once. | |
virtual XFCIMPORT INT32 | close () |
Closes file (also deletes the file object). | |
virtual XFCIMPORT INT | endOfFile () |
Returns 1 if at end of file. | |
XFCIMPORT INT32 | writeFLOAT32 (FLOAT32 aValue) |
Writes FLOAT32. | |
XFCIMPORT INT32 | writeFLOAT64 (FLOAT64 aValue) |
Writes FLOAT64. | |
XFCIMPORT INT32 | writeINT32 (INT32 aValue) |
Writes INT32. | |
XFCIMPORT INT32 | writeINT16 (INT16 aValue) |
Writes INT16. | |
XFCIMPORT INT32 | writeINT8 (INT8 aValue) |
Writes INT8. | |
XFCIMPORT INT32 | writeUINT32 (UINT32 aValue) |
Writes UINT32. | |
XFCIMPORT INT32 | writeUINT16 (UINT16 aValue) |
Writes UINT16. | |
XFCIMPORT INT32 | writeUINT8 (UINT8 aValue) |
Writes UINT8. | |
XFCIMPORT FLOAT32 | readFLOAT32 () |
Reads and returns FLOAT32. | |
XFCIMPORT FLOAT64 | readFLOAT64 () |
Reads and returns FLOAT64. | |
XFCIMPORT INT32 | readINT32 () |
Reads and returns INT32. | |
XFCIMPORT INT16 | readINT16 () |
Reads and returns INT16. | |
XFCIMPORT INT8 | readINT8 () |
Reads and returns INT8. | |
XFCIMPORT UINT32 | readUINT32 () |
Reads and returns UINT32. | |
XFCIMPORT UINT16 | readUINT16 () |
Reads and returns UINT16. | |
XFCIMPORT UINT8 | readUINT8 () |
Reads and returns UINT8. | |
XFCIMPORT INT32 | readFLOAT32 (FLOAT32 &aValue) |
Reads FLOAT32 to reference. | |
XFCIMPORT INT32 | readFLOAT64 (FLOAT64 &aValue) |
Reads FLOAT64 to reference. | |
XFCIMPORT INT32 | readINT32 (INT32 &aValue) |
Reads INT32 to reference. | |
XFCIMPORT INT32 | readINT16 (INT16 &aValue) |
Reads INT16 to reference. | |
XFCIMPORT INT32 | readINT8 (INT8 &aValue) |
Reads INT8 to reference. | |
XFCIMPORT INT32 | readUINT32 (UINT32 &aValue) |
Reads UINT32 to reference. | |
XFCIMPORT INT32 | readUINT16 (UINT16 &aValue) |
Reads UINT16 to reference. | |
XFCIMPORT INT32 | readUINT8 (UINT8 &aValue) |
Reads UINT8 to reference. | |
XFCIMPORT void | writeCHARString (CHAR *aValue) |
Writes a null-terminated CHAR string. | |
XFCIMPORT CHAR * | readCHARString () |
Reads a null-terminated CHAR string. | |
XFCIMPORT void | writeCHAR8String (CHAR8 *aValue) |
Writes a null-terminated CHAR8 string. | |
XFCIMPORT CHAR8 * | readCHAR8String () |
Reads a null-terminated CHAR8 string. | |
XFCIMPORT void | writeCHAR16String (CHAR16 *aValue) |
Writes a null-terminated CHAR16 string. | |
XFCIMPORT CHAR16 * | readCHAR16String () |
Reads a null-terminated CHAR16 string. | |
Static Public Member Functions | |
XFCIMPORT XFcFile * | open (const CHAR *aFilename, const CHAR *aMode, UINT32 aFindStrategy=XFCFO_DISKFIRST) |
XFCIMPORT XFcFile * | open (const CHAR *aFilename, const INT8 *aBuffer, const UINT32 aBufferLength) |
Creates XFcFile object using a memory buffer as read-only file. | |
XFCIMPORT XFcFile * | openDiskFile (const CHAR *aFilename, const CHAR *aMode) |
Opens a file from disk (to force loading only from disk). DEPRECATED. | |
XFCIMPORT XFcFile * | openCFLFile (const CHAR *aFilename, const CHAR *aMode) |
Opens from resource file (to force loading only from resource files). DEPRECATED. | |
XFCIMPORT INT | remove (const CHAR *aFilename) |
Removes file from disk. This function will not touch files inside read-only storage. | |
XFCIMPORT INT | rename (const CHAR *aOldFilename, CHAR *aNewFilename) |
Renames file on disk. This function will not touch files inside read-only storage. | |
XFCIMPORT INT | mkdir (const CHAR *aDirectoryname) |
Creates a directory in the filesystem. | |
XFCIMPORT INT | rmdir (const CHAR *aDirectoryname) |
Removes a directory in the filesystem. | |
XFCIMPORT INT8 * | getFile (const CHAR *aFilename, UINT32 aFindStrategy=XFCFO_DISKFIRST) |
Allocates sufficient amount of memory and reads the whole file in it. | |
XFCIMPORT INT32 | getFileSize (const CHAR *aFilename, UINT32 aFindStrategy=XFCFO_DISKFIRST) |
Returns the file size. | |
XFCIMPORT INT | fileExists (const CHAR *aFilename) |
Tests if a file exists. | |
Protected Member Functions | |
XFcFile () | |
Protected constructor. | |
virtual | ~XFcFile () |
Protected destructor. | |
Static Protected Member Functions | |
XFCIMPORT XFcFile * | openStdFile (const CHAR *aFilename, const CHAR *aMode) |
Opens a stdio file. | |
CHAR * | makeDiskFilenameString (const CHAR *aFilename) |
Creates a platform specific representation of a file name. | |
Protected Attributes | |
CHAR * | mFilename |
Copy of the filename. | |
void * | mFile |
File pointer, usually FILE *, or char * for ram-based files. | |
INT32 | mFilemode |
0 for disk file, 1 for CFL-stored file. | |
INT32 | mFlag |
Flags for the file state. |
Used in same way compared to C standard library FILE * handling functions. You can use XFuFileDef.h from xfutil library to hack stdio.h FILE *-using sources to use this class instead. Include that file after the standard library headers.
|
Protected constructor.
|
|
Protected destructor.
|
|
Closes file (also deletes the file object).
|
|
Returns 1 if at end of file.
|
|
Tests if a file exists.
|
|
Gets one byte from file. Returns EOF if end of file.
|
|
Allocates sufficient amount of memory and reads the whole file in it.
|
|
Returns pointer to the filename used to create this XFcFile object.
|
|
Returns the file size.
|
|
Creates a platform specific representation of a file name.
|
|
Creates a directory in the filesystem. If the parameter isn't prefixed with "//", the directory will be created under the application's root directory. Some platforms may be able to create whole directory hierarchies with one call, and some platforms may not support directories at all. You can create a directory on a different drive, etc, using the "//" prefix. See open() for description. |
|
Creates XFcFile object using a memory buffer as read-only file.
|
|
|
|
Opens from resource file (to force loading only from resource files). DEPRECATED.
|
|
Opens a file from disk (to force loading only from disk). DEPRECATED.
|
|
Opens a stdio file.
|
|
Puts one byte in the file.
|
|
Read chunk(s) from file at once.
|
|
Reads a null-terminated CHAR16 string.
|
|
Reads a null-terminated CHAR8 string.
|
|
Reads a null-terminated CHAR string.
|
|
Reads FLOAT32 to reference.
|
|
Reads and returns FLOAT32.
|
|
Reads FLOAT64 to reference.
|
|
Reads and returns FLOAT64.
|
|
Reads INT16 to reference.
|
|
Reads and returns INT16.
|
|
Reads INT32 to reference.
|
|
Reads and returns INT32.
|
|
Reads INT8 to reference.
|
|
Reads and returns INT8.
|
|
Reads UINT16 to reference.
|
|
Reads and returns UINT16.
|
|
Reads UINT32 to reference.
|
|
Reads and returns UINT32.
|
|
Reads UINT8 to reference.
|
|
Reads and returns UINT8.
|
|
Removes file from disk. This function will not touch files inside read-only storage.
|
|
Renames file on disk. This function will not touch files inside read-only storage.
|
|
Removes a directory in the filesystem. The directory removal will most likely fail if the directory is not empty.
|
|
Seeks to a certain position in the file.
|
|
Returns the file position.
|
|
Writes chunk(s) to file at once.
|
|
Writes a null-terminated CHAR16 string.
|
|
Writes a null-terminated CHAR8 string.
|
|
Writes a null-terminated CHAR string.
|
|
Writes FLOAT32.
|
|
Writes FLOAT64.
|
|
Writes INT16.
|
|
Writes INT32.
|
|
Writes INT8.
|
|
Writes UINT16.
|
|
Writes UINT32.
|
|
Writes UINT8.
|
|
File pointer, usually FILE *, or char * for ram-based files.
|
|
0 for disk file, 1 for CFL-stored file.
|
|
Copy of the filename.
|
|
Flags for the file state.
|
![]() | ||||
![]() |
Confidential Copyright © 2002-2003 Fathammer | with doxygen by Dimitri van Heesch |