Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

c4_FileStrategy Class Reference

A file strategy encapsulates code dealing with all file I/O. More...

#include <mk4io.h>

Inheritance diagram for c4_FileStrategy:

Inheritance graph
[legend]
List of all members.

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.

Detailed Description

A file strategy encapsulates code dealing with all file I/O.


The documentation for this class was generated from the following files:

Metakit C++ API Reference - https://www.equi4.com/metakit.html - extracted with Doxygen