nFile Class Reference
[File I/O and File System Access]
#include <nfile.h>
Inheritance diagram for nFile:

Detailed Description
Wrapper class for accessing file system files.provides functions for reading and writing files
(C) 2002 RadonLabs GmbH
Definition at line 32 of file nfile.h.
Public Types | |
| enum | nSeekType { CURRENT, START, END } |
| start point for seeking in file More... | |
Public Member Functions | |
| virtual bool | Exists (const nString &fileName) const |
| does the file physically exist on disk? | |
| virtual bool | Open (const nString &fileName, const nString &accessMode) |
| opens a file | |
| virtual void | Close () |
| closes the file | |
| virtual int | Write (const void *buffer, int numBytes) |
| writes some bytes to the file | |
| virtual int | Read (void *buffer, int numBytes) |
| reads some bytes from the file | |
| virtual int | Tell () const |
| gets actual position in file | |
| virtual bool | Seek (int byteOffset, nSeekType origin) |
| sets new position in file | |
| virtual bool | Eof () const |
| is the file at the end | |
| virtual int | GetSize () const |
| get size of file in bytes | |
| virtual nFileTime | GetLastWriteTime () const |
| get the last write time | |
| bool | PutS (const nString &buffer) |
| writes a string to the file | |
| bool | GetS (char *buffer, int numChars) |
| reads a string from the file | |
| int | GetLineNumber () const |
| get current line number (incremented by PutS() and GetS()) | |
| bool | IsOpen () const |
| determines whether the file is opened | |
| virtual int | AppendFile (nFile *other) |
| append one file to another file | |
| int | PutInt (int val) |
| write a 32bit int to the file | |
| int | PutShort (short val) |
| write a 16bit int to the file | |
| int | PutChar (char val) |
| write a 8bit int to the file | |
| int | PutFloat (float val) |
| write a float to the file | |
| int | PutDouble (double val) |
| write a double to the file | |
| int | GetInt () |
| read a 32 bit int from the file | |
| short | GetShort () |
| read a signed 16 bit int from the file | |
| ushort | GetUShort () |
| read an unsigned 16 bit int from the file | |
| char | GetChar () |
| read a 8 bit int from the file | |
| float | GetFloat () |
| read a float from the file | |
| double | GetDouble () |
| read a double from the file | |
Protected Member Functions | |
| nFile () | |
| NOTE: constructor is private because only nFileServer2 may create objects. | |
| virtual | ~nFile () |
| destructor | |
Protected Attributes | |
| ushort | lineNumber |
| bool | isOpen |
| FILE * | fp |
Friends | |
| class | nFileServer2 |
Member Enumeration Documentation
|
|
start point for seeking in file
|
Constructor & Destructor Documentation
|
|
NOTE: constructor is private because only nFileServer2 may create objects. history:
|
|
|
destructor history:
|
Member Function Documentation
|
|
does the file physically exist on disk? Check if file exists physically on disk by opening it in read-only mode. Close file if it was opened.
|
|
||||||||||||
|
opens a file opens the specified file
|
|
|
closes the file closes the file history:
|
|
||||||||||||
|
writes some bytes to the file writes a number of bytes to the file
|
|
||||||||||||
|
reads some bytes from the file reads a number of bytes from the file
|
|
|
gets actual position in file gets current position of file pointer
|
|
||||||||||||
|
sets new position in file sets the file pointer to given absolute or relative position
|
|
|
is the file at the end
|
|
|
get size of file in bytes Returns size of file in bytes.
|
|
|
get the last write time Returns time of last write access. The file must be opened in "read" mode before this function can be called! |
|
|
writes a string to the file writes a string to the file
|
|
||||||||||||
|
reads a string from the file reads a string from the file up to and including the first newline character or up to the end of the buffer
|
|
|
get current line number (incremented by PutS() and GetS())
|
|
|
determines whether the file is opened
|
|
|
append one file to another file Append the contents of another file to this file. This and the 'other' file must both be open! Returns number of bytes copied. Warning: current implementation reads the complete source file into a ram buffer.
|
|
|
write a 32bit int to the file
|
|
|
write a 16bit int to the file
|
|
|
write a 8bit int to the file
|
|
|
write a float to the file
|
|
|
write a double to the file
|
|
|
read a 32 bit int from the file
|
|
|
read a signed 16 bit int from the file
|
|
|
read an unsigned 16 bit int from the file
|
|
|
read a 8 bit int from the file
|
|
|
read a float from the file
|
|
|
read a double from the file
|
Friends And Related Function Documentation
|
|
|
Member Data Documentation
|
|
|
|
|
|
|
|
|
The documentation for this class was generated from the following files: