-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfacebookTakeOff.cpp
More file actions
80 lines (73 loc) · 2.38 KB
/
facebookTakeOff.cpp
File metadata and controls
80 lines (73 loc) · 2.38 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
74
75
76
77
#include "FB.h"
int main()
{
try
{
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
FB* fb = FB::getInstance();
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
if(nullptr == fb)
throw(std::invalid_argument("Allocation error"));
while(true)
{
switch(getChoice())
{
case '1':
{
std::string name, bDay;
bool cws;
getUserDetails(name, bDay, cws);
fb->newUser(name, bDay, cws);
}
break;
case '2':
{
std::string user2 = readString("To whom do you want to write status? ");
std::string user1 = readString("What is your name ? ");
fb->addStatus(user1, user2);
}
break;
case '3':
{
std::string name = readString("which user wall? ");
fb->showWall(name);
}
break;
case '4':
{
std::string user2 = readString("which user wall? ");
std::string user1 = readString("which user wall? ");
fb->connectUsers(user1, user2);
}
break;
case '5':
fb->printAllUsers();
break;
case '6':
{
std::string name = readString("which user friends list ? ");
fb->showUsersFriendsList(name);
}
break;
case '7':
{
std::string name2 = readString("Who would you want to remove? ");
std::string name1 = readString("which page? ");
fb->removeFanFromPage(name1, name2);
}
break;
case '8':
delete fb;
return 0;
break;
default:
break;
}
}
}
catch(const std::invalid_argument& e)
{
std::cerr << e.what() << '\n';
}
return -1;
}