#include <File.h>
Inherited by WDFFile.
Inheritance diagram for File:

Public Methods | |
| File () | |
| Default constuctor. | |
| File (const string &name) | |
| Constuct and open a file. | |
| ~File () | |
| Destructor, closes the file. | |
| FILE * | handle () |
| Returns the FILE pointer. | |
| unsigned int | tell () |
| Return the file position. More... | |
| int | seek (long offset, int whence=SEEK_SET) |
| Set the file position. More... | |
| void | open (const string &name) |
| Opens a file for reading. More... | |
| void | create (const string &name) |
| Creates a file for writing. More... | |
| void | close () |
| Closes the file. More... | |
| int | readAsciiInteger () |
| Reads an ascii interger. More... | |
| void | readString (string &name) |
| Reads a null terminated string. | |
| uint16 | readChar () |
| Reads a single character. | |
| uint16 | readShort () |
| Reads a 2-byte integer value. | |
| uint32 | readInt () |
| Reads a 4-byte integer value. | |
| float | readFloat () |
| Reads a floating point value. | |
| void | writeString (const string &name) |
| Writes a null terminated string. | |
| void | writeChar (uint16 ch) |
| Writes a single character. | |
| void | writeShort (uint16 i) |
| Writes a 2-byte integer value. | |
| void | writeInt (uint32 i) |
| Writes a 4-byte integer value. | |
| void | writeFloat (float fl) |
| Writes a floating point value. | |
Protected Attributes | |
| FILE * | f |
| File pointer. | |
| EndianShip | endianShip |
| The endianship of the file. | |
Wrapper for randon acces FILE.
|
|
Closes the file.
|
|
|
Creates a file for writing.
Reimplemented in WDFFile. |
|
|
Opens a file for reading.
Reimplemented in WDFFile. |
|
|
Reads an ascii interger. This method first skips all whitespace and then reads an interger value. |
|
||||||||||||
|
Set the file position. Use fseek to set the position for the file. The value of offset determines the new position, in one of three ways selected by the value of whence (defined as macros in ` stdio.h'):
|
|
|
Return the file position. The result of tell is the current position for the file. If you record this result, you can later use it with fseek to return the file to this position.
|