#include <mk4io.h>
Inheritance diagram for c4_FileStrategy:
Public Member Functions | |
c4_FileStrategy (FILE *file_=0) | |
Construct a new strategy object. | |
virtual bool | IsValid () const |
True if we can do I/O with this object. | |
virtual bool | DataOpen (const char *fileName_, int mode_) |
Open a data file by name. | |
virtual int | DataRead (t4_i32 pos_, void *buffer_, int length_) |
Read a number of bytes. | |
virtual void | DataWrite (t4_i32 pos_, const void *buffer_, int length_) |
Write a number of bytes, return true if successful. | |
virtual void | DataCommit (t4_i32 newSize_) |
Flush and truncate file. | |
virtual void | ResetFileMapping () |
Support for memory-mapped files. | |
virtual t4_i32 | FileSize () |
Report total size of the datafile. | |
virtual t4_i32 | FreshGeneration () |
Return a good value to use as fresh generation counter. | |
Protected Attributes | |
FILE * | _file |
Pointer to file object. | |
FILE * | _cleanup |
Pointer to same file object, if it must be deleted at end. |