/* datafile.h * * This is the header file for the Datafile data type. * */ #ifndef DATAFILE_H #define DATAFILE_H #include using namespace std; // This is the Datafile class // It represents a Datafile entry from the input file. class Datafile { private: long int number; // the student's id string lastname; // the student's lastname string firstname; // the student's firstname int credits; // the student's credits int credits_term; // the student's credits in this term float CGPA; // the student's CGPA int number_length; int lastname_length; int firstname_length; int credits_length; int CGPA_length; // set the record size, which is the sum of the lengths // of the student number field, the name field, and // extra end-of-line characters int recsize; public: // This constructor sets up the Student object. Datafile(); // This is the destructor for the class. virtual ~Datafile(); // Student number accessors long int getNumber() const; void setNumber(long int); // Student lastname accessors string getLastName() const; void setLastName(string); // Student firstname accessors string getFirstName() const; void setFirstName(string); // Student credits accessors int getCredits() const; void setCredits(int); // Student credits in this term accessors int getCredits_term() const; void setCredits_term(int); // Student CGPA accessors float getCGPA() const; void setCGPA(float); // seek to the appropriate position for reading void InputPositioningByRRN(int RRN, istream&); // seek to the appropriate position for writing void OutputPositioningByRRN(int RRN, ostream&); // modify the name of a student stored in a file void ModifyBucketFile(int, ostream&, string); }; #endif