Tools.h++ Class Reference

Table Of Contents
mode is as given by the Standard C library function fopen(). If mode is zero (the default)
then the constructor will attempt to open an existing file with the given filename for
update (mode "rb+"). If this is not possible, then it will attempt to create a new file with
the given filename (mode "wb+"). The resultant object should be checked for validity
using function isValid().
~RWFile();
Performs any pending I/O operations and closes the file.
Public Member Functions
const char*
Access();
Returns the access mode with which the underlying FILE* was opened.
void
ClearErr();
Reset error state so that neither Eof() nor Error() returns TRUE. Calls C library function
clearerr().
RWoffset
CurOffset();
Returns the current position, in bytes from the start of the file, of the file pointer.
RWBoolean
Eof();
Returns TRUE if an end-of-file has been encountered.
RWBoolean
Erase();
Erases the contents but does not close the file. Returns TRUE if the operation was
successful.
RWBoolean
Error();
Returns TRUE if a file I/O error has occurred as determined by a call to the C library
function ferror().
RWBoolean
Exists();
Returns TRUE if the file exists.
RWBoolean
Flush();
Perform any pending I/O operations. Returns TRUE if successful.