/* * CSI2131 Winter 2005 * * Assignment#2 Solution : The DataFile class *(Handles insertion to and retrieval from the datafile) * * Shantanu Das */ #ifndef DATAFILE_H #define DATAFILE_H #include "Record.h" #include #include #include using namespace std; class DataFile { private: fstream *fp; // Pointer to the datafile public: //DataFile() { fp=NULL; } DataFile(fstream&); //Constructor virtual ~DataFile(); //Destructor long appendRec(Record& rec); //method for inserting new record into the file bool readNextRec(Record& rec); bool getRec(long ofs, Record& rec); // get the record at byte-offset ofs, into the record rec void GoToStart(); }; #endif