-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccountList.h
More file actions
51 lines (46 loc) · 1.23 KB
/
AccountList.h
File metadata and controls
51 lines (46 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef ACCOUNTLIST_H
#define ACCOUNTLIST_H
#include <fstream>
#include <string>
#include "Account.h"
#include "BookList.h"
#include <map>
#include <sstream>
#include <unordered_map>
using namespace std;
class AccountList
{
public:
AccountList(){};
//Reads file and inserts data
AccountList(const string AccountsFile, BookList myLib);
//Adds account
void AddAccount(string Name);
//Adds account
void AddAccount(Account* someAccount);
//Removes account with ID
void removeAccount(int AccountID);
//Add given book to account with given ID
void AddBookToAccount(int UserID, Book* Book);
//void checkBookAvailability(int ID);
//Print user info with ID
void printUserInfo(int ID);
//Print aAll user info
void PrintAll(string criteria);
//Orders Accounts by criteria
vector<Account*> order(string criteria);
//returns account with id
Account* findAccount(int UserID);
//Prints out how many overdue accounts
int OverdueAccounts();
//retruns number of Accounts
int getSize(){return ListOfAccounts.size();}
//Outputs accounts into a file in format
void OutputAccounts(string accountsfile);
//check if account with ID exists
bool hasAccount(int ID);
private:
unordered_map <int, Account*> ListOfAccounts;
int highestID;
};
#endif