-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (29 loc) · 702 Bytes
/
Copy pathmain.cpp
File metadata and controls
34 lines (29 loc) · 702 Bytes
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
#include "commands.hpp"
#include <cstdlib>
#include <iostream>
#include <sstream>
using namespace std;
/* Interfata cu utilizatorul */
int main()
{
Client client;
string string_line;
while (getline(cin, string_line))
{
/* Se proceseaza comenzile */
auto info = commands::functions.find(string_line);
if (string_line.empty())
{
fprintf(stdout, "No command\n");
continue;
}
if (info == commands::functions.end())
{
fprintf(stdout, "Not a valid command\n");
continue;
}
/* Se apeleaza functia corespunzatoare */
info->second(client);
}
return 0;
}