class WorkManDB : public AudDB

WorkMan-style audio database.

Inheritance:

WorkManDB < AudDB


Public Methods

void open(void)
WorkManDB(void)
WorkManDB(char *fname)
~WorkManDB(void)

Protected Fields

streampos* seeklist

Protected Methods

bool appendEntry(Catalog& ct)
bool deleteEntry(Catalog& ct)
bool read_i(Catalog& ct, int idx)
bool readEntry(ifstream& instr, Catalog& ct)
bool replaceEntry(Catalog& ct)
void rescanDB(ifstream& instr)
void write(Catalog& ct, int& oldlen)
bool writeEntry(ofstream& outstr, Catalog& ct)

Inherited from AudDB:

Public Methods

void add(Catalog &ct)
virtual bool read(Catalog& ct)
void setName(char *name)

Protected Fields

char* db_name
int len_magic
unsigned long* magiclist

Protected Methods

int find(Catalog& ct)

Documentation

WorkManDB is a AudDB implemented to work with WorkMan-style databases.

WorkManDB(void)
Class Constructor

WorkManDB(char *fname)
Overloaded Constructor. Sets db_name to a duplicate of the argument fname.

~WorkManDB(void)
Class Destructor.

void open(void)
[virtual]

Reimplements the AudDB version. Because WorkMan-style databases reside in a single file, open() also collects and stores the seek-positions of each record in the database.

streampos* seeklist
An array containing the position of each record in the file. Has the same length as magiclist.

void write(Catalog& ct, int& oldlen)
[virtual]

Reimplements the AudDB version. Replaces ct if it's already in the database. If it's not, it appends ct to the database, and increments oldlen.

bool read_i(Catalog& ct, int idx)
[virtual]

Reimplements the AudDB version. Opens an input stream, seeks the position at seeklist[idx], then calls readEntry.

bool readEntry(ifstream& instr, Catalog& ct)
[virtual]

Reimplements the AudDB version.

bool writeEntry(ofstream& outstr, Catalog& ct)
[virtual]

Reimplements the AudDB version.

void rescanDB(ifstream& instr)
Called by open(). Once len_magic has been set to some nonzero value, rescanDB scans the input stream, instr, for len_magic records, storing their magic numbers and their seek positions.

bool appendEntry(Catalog& ct)
Appends the Catalog ct to the end of the database. Stores the new position of ct in seeklist, but doesn't update anything else.

bool deleteEntry(Catalog& ct)
Deletes the entry ct from the database. It is very careful about doing this. When done, it decrements len_magic and performs a rescanDB on the altered database file.

bool replaceEntry(Catalog& ct)
Replaces an exiting entry, ct, in the database. Does so by first calling deleteEntry, then calling appendEntry, and lastly updating magiclist, since only seeklist gets updated by appendEntry.


This class has no child classes.

alphabetic index hierarchy of classes


Copyright 1997 by John Weiss [John.Weiss@colorado.edu] "generated by doc++"?! More like mangled ...

generated by doc++