-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCommand.hpp
More file actions
60 lines (53 loc) · 1.26 KB
/
Command.hpp
File metadata and controls
60 lines (53 loc) · 1.26 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
#pragma once
# include <vector>
# include <locale>
# include <ctime>
# include <chrono>
# include <sstream>
# include <stdlib.h>
class Server;
class User;
class Command
{
private:
//cadenas prefix, nombre, params
//int _num_params
Server &_server;
User &_commander;
std::string _prefix;
std::string _command;
std::string *_params;
std::string *_extra;
int _paramsNum;
Command(void);
Command(const Command &other);
public:
// Constructor + Destructor
Command(std::string str, Server &server, User &commander); // Prefix, Command and Parameters parser.
~Command(void);
// Getters + Setters
std::string getCommand(void) const;
std::string *getParams() const;
std::string *getExtra() const;
// Functions
int parseStr(std::string str);
std::vector<std::string> parseParam(std::string param);
void execute();
void numeric_reply(int key, std::string rply="", int socket=0);
// Commands
void ftPASS();
void ftNICK();
void ftUSER();
void ftOPER();
void ftQUIT();
void ftJOIN();
void ftPART();
void ftTOPIC();
void ftNAMES();
void ftLIST();
void ftKICK();
void ftPRIVMSG();
void ftMODE();
};
# include "Server.hpp"
# include "User.hpp"