Listing 1: Class ISAMFile skeleton
#include "isamdefs.h" // boolean
//Portions of file not shown here, to save space. Full
//source is available electronically. See p. 3 for details -- mb
// ...
class ISAMFile {
public:
/* Nested Type Declarations */
typedef int AccessID; // used for build, open, close
typedef long CountType; // used for counting num recs
enum { MAX_KEY_PARTS = 16 }; // 16 is specific to ISAM engine
// used in current implementation
// enums not shown: RecFieldTypes, LockModes, AccessModes,
// SearchModes, IndexKeyFlags -- mb
// ...
struct KeyField {
short start; // byte position within rec
short len; // length of field in bytes
int flags; // descending or noCase
RecFieldTypes type; // data type
};
struct IndexKey {
short flags; // duplicates, noDuplicates, or noChange
short nparts; // number of fields in the key
KeyField parts[MAX_KEY_PARTS];
};
/*@Constructors */
ISAMFile();
ISAMFile( const char * file_name);
~ISAMFile();
// not shown: selectors, file manipulation modifiers, index
// manipulation modifiers, read/write routines, transaction
// management routines, lock management routines -- mb
// ...
ISAMErrorReadCur(AccessID file_id, char * record, boolean lock = FALSE);
private:
String fileName_;
static int sTransNestLevel_; // static because transaction
// nesting levels are a system-wide resource
/* Static Interface */
public:
static boolean IsFileIDValid( AccessID file_id );
static void InvalidateID( AccessID * file_id );
static int GetErrString( char * buf, const char * format,
ISAMError error_code );
};
/* End of File */