#include <file.h>
Inheritance diagram for RandomFile::
Public Methods | |
virtual | ~RandomFile () |
Destroy a random access file or it's derived class. More... | |
bool | Initial (void) |
This method should be called right after a RandomFile derived object has been created. More... | |
off_t | getCapacity (void) |
Get current file capacity. More... | |
virtual fileerror_t | Restart (void) |
This method is commonly used to close and re-open an existing database. More... | |
fileerror_t | getErrorNumber (void) |
Return current error id. More... | |
char * | getErrorString (void) |
Return current error string. More... | |
bool | operator! (void) |
Protected Methods | |
RandomFile () | |
Create an unopened random access file. More... | |
RandomFile (const RandomFile &rf) | |
Default copy constructor. More... | |
fileerror_t | Error (fileerror_t errid, char *errstr=NULL) |
Post an error event. More... | |
fileerror_t | Error (char *errstr) |
Post an extended string error message. More... | |
void | setError (bool enable) |
Used to enable or disable throwing of exceptions on errors. More... | |
fileerror_t | setCompletion (filecomplete_t mode) |
Used to set file completion modes. More... | |
void | setTemporary (bool enable) |
Used to set the temporary attribute for the file. More... | |
virtual fileattr_t | Initialize (void) |
This method is used to initialize a newly created file as indicated by the "initial" flag. More... | |
void | Final (void) |
Close the file. More... | |
Protected Attributes | |
int | fd |
fileaccess_t | access |
char * | pathname |
RandomFile:: { ... } | flags |
unsigned | count: 16 |
bool | thrown: 1 |
bool | initial: 1 |
bool | immediate: 1 |
bool | temp: 1 |
This class is a foundation both for optimized thread shared and traditional locked file access that is commonly used to build database services, rather than the standard C++ streaming file classes.
|
Create an unopened random access file.
|
|
Default copy constructor.
|
|
Destroy a random access file or it's derived class.
|
|
Post an extended string error message.
|
|
Post an error event.
|
|
Close the file.
|
|
This method should be called right after a RandomFile derived object has been created. This method will invoke initialize if the object is newly created, and set file access permissions appropriately.
|
|
This method is used to initialize a newly created file as indicated by the "initial" flag. This method also returns the file access permissions that should be associated with the file. This method should never be called directly, but is instead used to impliment the "Initial" method. Typically one would use this to build an empty database shell when a previously empty database file is created.
|
|
This method is commonly used to close and re-open an existing database. This may be used when the database has been unlinked and an external process provides a new one to use. Reimplemented in ThreadFile, and SharedFile. |
|
Get current file capacity.
|
|
Return current error id.
|
|
Return current error string.
|
|
|
|
Used to set file completion modes.
|
|
Used to enable or disable throwing of exceptions on errors.
|
|
Used to set the temporary attribute for the file. Temporary files are automatically deleted when closed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|