?? accountmanage.h.bak
字號:
/*
* File: accountmanage.h
* ----------------
* This file declares the class AccountManage,
* to manage the accounts.
*/
#ifndef ACCOUNTMANAGE_H
#define ACCOUNTMANAGE_H
#include "account.h"
/*
* Struct: AllAccountList
* --------------------------
* This Struct list contains all
* the accounts in the hotel.
*/
struct AllAccountList
{
Account *curAccount;
struct AllAccountList *next;
};
/*
* Class: AccountManage
* -------------------------
* This class contains a list of all
* accounts and operation functions.
*/
class AccountManage
{
public:
AccountManage(); // constructor.
//void SetNumOfAccount( int );
int GetNumOfAccounts();
void AddAccount( Account * ); // add an account to the allAccountList.
bool DeleteAccount( Account * ); // delete an account to the allAccountList.
// Find an account by his ID or name or creditCardNum or phoneNum..
Account *GetAccount( int = -1, string = "", string = "", int = 0 ); //add
struct AllAccountList *GetAllAccountList();
void PrintAccountList( int ); // print all the account info briefly in the allAccountList.
void PrintAccountInfo( Account * ); // print the account info in detail.
void WriteToFile( ofstream *fout );/// // write the accounts info in the allAccountList to the data file.
void ReadFromFile( ifstream *fin );/// // read the accounts info from the data file.
void CleanAllAccount(); // free all accounts' info in memory,and empty the allAccountList.
~AccountManage(); // destructor.
private:
int numOfAccounts;
struct AllAccountList *allAccountList;
};
/*
* Function: NewAccount()
* Usage: *Account=*NewAccount(ID);
* ---------------------------
* This function allow the user to create a new account
* by entering all the account info,
* and the account's ID will be set in default,
* and returns the pointer of the new account.
*/
Account *NewAccount( int );
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -