-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUser.h
More file actions
executable file
·73 lines (58 loc) · 1.42 KB
/
User.h
File metadata and controls
executable file
·73 lines (58 loc) · 1.42 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef USER_H
#define USER_H
#include "Activity.h"
#include "Queue.h"
#include <cstddef>
#include <iostream>
#include <string>
using namespace std;
class User {
private:
string name;
string phone;
string handel;
size_t age;
public:
Queue<Activity> activites;
User(string name, string phone, string handel, int age);
User();
void displayInfo();
string getName() const;
string getPhone() const;
string getHandel() const;
size_t getAge() const;
void SetHandle(string newHandle) { this->handel = newHandle; }
User(const User &other)
: name(other.name), phone(other.phone), handel(other.handel),
age(other.age) {}
User &operator=(const User &other) {
if (this != &other) {
// Copy each member variable
name = other.name;
phone = other.phone;
handel = other.handel;
age = other.age;
}
return *this;
}
void addPost(const string &content);
void MakeCopy(User &user) {
this->handel = user.handel;
this->age = user.age;
this->name = user.name;
this->phone = user.phone;
}
void SetData() {
cout << "Enter user name: ";
cin >> this->name;
cout << "Enter user phone: ";
cin >> this->phone;
cout << "Enter user handle: ";
cin >> this->handel;
cout << "Enter user age: ";
cin >> this->age;
}
void addLikes(size_t post_num, size_t Likes);
void addViews(size_t post_num, size_t Views);
};
#endif // USER_H