An interface to fstream to allow easy reading and writing of memory blocks. More...
#include <FileIO.h>
Public Member Functions | |
FileIO (const char *filename) | |
Construct the file stream in input/output mode. | |
FileIO (const char *filename, std::ios::openmode mode) | |
Construct the file stream in a specified mode. | |
void | open (std::ios::openmode mode) |
Open a previously closed stream. | |
void | close (void) |
Close a file stream. | |
FILE_POS_TYPE | fileSize (void) |
Return the length of the file in bytes. | |
void | readBlock (char *buffer, int blockSize) |
Read a file block of size blockSize bytes. | |
void | writeBlock (char *buffer, int blockSize) |
Write a file block of size blockSize bytes. | |
FILE_POS_TYPE | repositionRead (FILE_POS_TYPE filePos) |
Move the read pointer to position filePos. | |
FILE_POS_TYPE | repositionWrite (FILE_POS_TYPE filePos) |
Move the write pointer to position filePos. | |
void | truncateFile (FILE_POS_TYPE fileSize) |
Truncate (or crop) the file to size fileSize. |
An interface to fstream to allow easy reading and writing of memory blocks.
This class is meant as an example. It is not useful by itself rather its usefulness is only a function of how much it helps the reader. It is in a sense defined by the person who reads it and otherwise does not exist in any real form.
Contact: laurence@parktribe.com