The purpose of this class is to define a base class for low level random file access that is portable between Win32 and Posix systems.
More...
Public Member Functions |
off_t | getCapacity (void) |
| Get current file capacity.
|
Error | getErrorNumber (void) |
| Return current error id.
|
char * | getErrorString (void) |
| Return current error string.
|
bool | initial (void) |
| This method should be called right after a RandomFile derived object has been created.
|
bool | operator! (void) |
virtual Error | restart (void) |
| This method is commonly used to close and re-open an existing database.
|
virtual | ~RandomFile () |
| Destroy a random access file or it's derived class.
|
Protected Member Functions |
Error | error (Error errid, char *errstr=((void *) 0)) |
| Post an error event.
|
Error | error (char *err) |
| Post an extended string error message.
|
void | final (void) |
| Close the file.
|
virtual Attr | initialize (void) |
| This method is used to initialize a newly created file as indicated by the "initial" flag.
|
| RandomFile (const char *name=((void *) 0)) |
| Create an unopened random access file.
|
| RandomFile (const RandomFile &rf) |
| Default copy constructor.
|
Error | setCompletion (Complete mode) |
| Used to set file completion modes.
|
void | setError (bool enable) |
| Used to enable or disable throwing of exceptions on errors.
|
void | setTemporary (bool enable) |
| Used to set the temporary attribute for the file.
|
Protected Attributes |
Access | access |
int | fd |
struct { |
unsigned count: 16 |
bool immediate: 1 |
bool initial: 1 |
bool temp: 1 |
bool thrown: 1 |
} | flags |
char * | pathname |
Related Functions |
(Note that these are not member functions.)
|
bool | canAccess (const char *path) |
bool | canModify (const char *path) |
bool | isDevice (const char *path) |
bool | isDir (const char *path) |
bool | isFile (const char *path) |
time_t | lastAccessed (const char *path) |
time_t | lastModified (const char *path) |
The purpose of this class is to define a base class for low level random file access that is portable between Win32 and Posix systems.
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.
- Author:
- David Sugar <dyfet@ostel.com> Portable random disk file access.
Definition at line 376 of file file.h.