Website Summary Files Commits Branches @commit @diff @stats
path: root / Week07 / Exercise01 / User.h
blob: 7e045601902897f9b5ac9ee356c38a4793b0b600 (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
#ifndef _USER
#define _USER

#include "String.h"
#include "Book.h"

class User {
	String email;
	String password;
	unsigned bankCard;

	// Масив от указатели към книги
	const Book** library;
	unsigned libraryCount;
	unsigned libraryAlloc;

	void copyFrom(const User& other);
	void free();

	void resizeLibrary();

public:
	User();
	~User();
	User(const User& other);
	User& operator=(const User& other);
	User(User&& other);
	User& operator=(User&& other);

	void SetEmail(const String& newEmail);
	const String& GetEmail() const;

	void SetPassword(const String& newPassword);

	bool Login(const String& email, const String& password);

	void AddBookToLibrary(const Book* book);
	void ListLibrary();
	const Book* GetBook(unsigned index) const;

	void SetBankCard(unsigned newBankCard);
	unsigned GetBankCard() const;
};

#endif /* _USER */