-
Notifications
You must be signed in to change notification settings - Fork 0
/
Book.cpp
109 lines (89 loc) · 2.11 KB
/
Book.cpp
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#include <iostream>
#include "Book.h"
using namespace std;
Book::Book()
{
serialNumber = " ";
title = " ";
author = " ";
pageCount = 0;
freePage = 0;
categorie = -1;
visibilityStatus = false;
availabilityStatus = false;
}
Book::Book(string sn, string t, string a, int pc, int fp, bool vs, bool as, int c)
: serialNumber(sn), title(t), author(a), pageCount(pc), freePage(fp),
visibilityStatus(vs), availabilityStatus(as), categorie(c) {}
Book::~Book() {}
string Book::getSerialNumber() {
return serialNumber;
}
string Book::getTitle() {
return title;
}
string Book::getAuthor() {
return author;
}
int Book::getPageCount() {
return pageCount;
}
int Book::getFreePage() {
return freePage;
}
string Book::getCategorie() {
if (categorie == 0) {
return "Culture";
}
if (categorie == 1) {
return "Science";
}
if (categorie == 2) {
return "Fiction";
}
}
bool Book::getVisibilityStatus() {
return visibilityStatus;
}
bool Book::getAvailabilityStatus() {
return availabilityStatus;
}
void Book::setSerialNumber(string sn) {
serialNumber = sn;
}
void Book::setTitle(string t) {
title = t;
}
void Book::setAuthor(string a) {
author = a;
}
void Book::setPageCount(int pc) {
pageCount = pc;
}
void Book::setFreePage(int fp) {
freePage = fp;
}
void Book::setCategorie(int c) {
categorie = c;
}
void Book::setVisibilityStatus(bool vs) {
visibilityStatus = vs;
}
void Book::setAvailabilityStatus(bool as) {
availabilityStatus = as;
}
Book& Book::operator=(const Book& b)
{
// TODO: insert return statement here
if (this != &b) {
this->author = b.author;
this->availabilityStatus = b.availabilityStatus;
this->categorie = b.categorie;
this->freePage = b.freePage;
this->pageCount = b.pageCount;
this->serialNumber = b.serialNumber;
this->title = b.title;
this->visibilityStatus = b.visibilityStatus;
}
return *this;
}