-
Notifications
You must be signed in to change notification settings - Fork 0
/
User.cpp
54 lines (50 loc) · 1.17 KB
/
User.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
#include "User.hpp"
// Get Functions
std::string User::getPaswd() {
return password;
}
std::string User::getUsrnm() {
return username;
}
std::string User::getSurnm() {
return surname;
}
std::string User::getName() {
return name;
}
std::string User::getBirth() {
return birth.getDate();
}
// Set Functions
void User::setPaswd(std::string p) {
this->password = p;
}
void User::setUsrnm(std::string u) {
this->username = u;
}
void User::setName(std::string n) {
this->name = n;
}
void User::setSname(std::string sn) {
this->surname = sn;
}
void User::setBirth(std::string b) {
this->birth.setDate(b);
}
// Friend Functions
std::ostream& operator<<(std::ostream& out, const User& temp) {
out << "name\t\t" << temp.name
<< "surname\t" << temp.surname
<< "birth\t\t" << temp.birth
<< "username\t" << temp.username
<< "password\t" << temp.password;
return out;
}
std::istream& operator>>(std::istream& in, User& temp) {
std::cout << "name:\t\t"; in >> temp.name;
std::cout << "surname:\t"; in >> temp.surname;
std::cout << "birth:\t\t"; in >> temp.birth;
std::cout << "username:\t"; in >> temp.username;
std::cout << "password:\t"; in >> temp.password;
return in;
}