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...
Protected Member Functions |
| RandomFile (const char *name=NULL) |
| Create an unopened random access file.
|
| RandomFile (const RandomFile &rf) |
| Default copy constructor.
|
Error | error (Error errid, char *errstr=NULL) |
| Post an error event.
|
Error | error (char *err) |
| Post an extended string error message.
|
void | setError (bool enable) |
| Used to enable or disable throwing of exceptions on errors.
|
Error | setCompletion (Complete mode) |
| Used to set file completion modes.
|
void | setTemporary (bool enable) |
| Used to set the temporary attribute for the file.
|
virtual Attr | initialize (void) |
| This method is used to initialize a newly created file as indicated by the "initial" flag.
|
void | final (void) |
| Close the file.
|
| Mutex (const char *name=NULL) |
| The mutex is always initialized as a recursive entity.
|
virtual | ~Mutex () |
| Destroying the mutex removes any system resources associated with it.
|
void | nameMutex (const char *name) |
| Enable setting of mutex name for deadlock debug.
|
void | enterMutex (void) |
| Entering a Mutex locks the mutex for the current thread.
|
void | enter (void) |
| Future abi will use enter/leave/test members.
|
void | leave (void) |
| Future abi will use enter/leave/test members.
|
bool | test (void) |
| Future abi will use enter/leave/test members.
|
bool | tryEnterMutex (void) |
| Tries to lock the mutex for the current thread.
|
void | leaveMutex (void) |
| Leaving a mutex frees that mutex for use by another thread.
|
Additional Inherited Members |
enum | Error {
errSuccess = 0,
errNotOpened,
errMapFailed,
errInitFailed,
errOpenDenied,
errOpenFailed,
errOpenInUse,
errReadInterrupted,
errReadIncomplete,
errReadFailure,
errWriteInterrupted,
errWriteIncomplete,
errWriteFailure,
errLockFailure,
errExtended
} |
enum | Access { accessReadOnly = O_RDONLY,
accessWriteOnly = O_WRONLY,
accessReadWrite = O_RDWR
} |
enum | Open {
openReadOnly = O_RDONLY,
openWriteOnly = O_WRONLY,
openReadWrite = O_RDWR,
openAppend = O_WRONLY | O_APPEND,
openSync = O_RDWR,
openTruncate = O_RDWR | O_TRUNC
} |
enum | Attr { attrInvalid = 0,
attrPrivate = 0400 | 0200,
attrGroup = attrPrivate | 0040 | 0020,
attrPublic = attrGroup | 0004 | 0002
} |
enum | Mapping { mappedRead = accessReadOnly,
mappedWrite = accessWriteOnly,
mappedReadWrite = accessReadWrite
} |
enum | Complete { completionImmediate,
completionDelayed,
completionDeferred
} |
typedef enum Error | Error |
typedef enum Access | Access |
typedef enum Open | Open |
typedef enum Attr | Attr |
typedef enum Complete | Complete |
typedef enum Mapping | Mapping |
static const char * | getExtension (const char *path) |
static const char * | getFilename (const char *path) |
static char * | getFilename (const char *path, char *buffer, size_t size=64) |
static char * | getDirname (const char *path, char *buffer, size_t size=256) |
static char * | getRealpath (const char *path, char *buffer, size_t size=256) |
typedef struct ost::File::_fcb | fcb_t |
static void | setDebug (bool mode) |
| Enable or disable deadlock debugging.
|
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.nosp@m.@ost.nosp@m.el.co.nosp@m.m Portable random disk file access.