db.h

来自「C++ class and storage」· C头文件 代码 · 共 56 行

H
56
字号
#ifndef _DB_H#define _DB_H#include "Record.h"#define MAX_NUM_OF_STUDENTS 1000class DB {private:	Record *_arrayDB[MAX_NUM_OF_STUDENTS];	int _next_index;public:	// the default constructor, creates an empty database. 	DB();	// the destructor, deletes all the records in the database.	~DB();	// inserts the record pointed to by newRecord into the database.         // If a record with the same  number as newRecord's exists         // in the database, it returns false. Otherwise, it returns true.  	// If database is full, it silently fails.	bool insert(Record *newRecord); 	// searches the database for a record with Num, 	// if the record is found, its content will be copied to 	// the searchRecord, and the method returns true. Otherwise	// the method returns false.	bool retrieve(unsigned int Num, Record * & searchRecord);	// deletes the record with Num from the database. If 	// the record was indeed in the database, it returns true.	// Returns false otherwise.	bool remove(unsigned int Num);	// deletes all the records in the database.	void clear();	// returns true if there is no record in the database, otherwise,	// it returns false.	bool isEmpty();	// returns true if the database is full, i.e. no further 	// records can be inserted into the database, otherwise, it returns	// false.	bool isFull(); 	// dumps the content of the database to the standard output (using 	// the "print" method of the Record class), sorted in ascending	// order of  numbers, separated by empty lines. 	void dump();}; //DB#endif 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?