blob: f610972767ddfb1bbe6db00744c46a69085a9229 (
plain) (
blame)
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
52
53
54
55
|
#pragma once
#include"vector.hpp"
#include"Book.h"
#include"User.h"
#include"Pair.hpp"
#include<iostream>
#include<cstring>
#include<fstream>
class Kindle {
private:
Vector<Book> lib;
Vector<User> users;
// Helper functions
int findBookIndex(const string& name) const;
int findUserIndex(const string& name) const;
// did user read the book?
bool userReadTheBook(const User& currentUser, int bookIndex) const;
// does user exist?
bool existUser(const string& userName) const;
// Functions used by user
void readBookDialog(User& reader);
void writeBookDialog(User& writer);
void rateBookDialog(const User& rater);
void commentOnBookDialog(const User& commenter);
void displayCommentsDialog() const;
void displayRatesDialog() const;
// TODO: Change book (add or remove page etc.)
// Functions used by main dialog
void displayLoginDialog();
void displaySignupDialog();
void displayUserDialog(User& currentUser);
void saveFileDialog() const;
void readFileDialog();
void viewBooks() const;
void showHelpDialog() const;
// read && write
void saveToFile(const char* filePath) const;
void readFromFile(const char* filePath);
public:
// The only function used by our Kindle class
void display();
};
|