-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathClient.hpp
More file actions
64 lines (51 loc) · 1.23 KB
/
Client.hpp
File metadata and controls
64 lines (51 loc) · 1.23 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
#ifndef CLIENT_HPP
#define CLIENT_HPP
#include <iostream>
#include <sys/socket.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <set>
#define BUFFER_SIZE 520
#define END 0
#define CONTINUE 1
class Client
{
private:
int _fd;
bool _is_passed;
bool _is_ping;
std::string _nickname;
std::string _username;
std::string _realname;
std::string _ip;
std::string _recv_buffer;
std::string _send_buffer;
std::set<std::string> _joined_channels;
public:
Client(int _fd);
~Client();
void setNickname(std::string const &nickname);
void setUsername(std::string const &username);
void setRealname(std::string const &realname);
void setRecvBuf(std::string message);
void setSendBuf(std::string message);
void addChannel(std::string channel);
void delChannel(std::string channel);
void setPassed(bool flag);
void setPing(bool flag);
int getFd() const;
std::string getNickname() const;
std::string getUsername() const;
std::string getIp() const;
std::string getRealname() const;
std::string getRecvBuf() const;
std::string getSendBuf() const;
std::set<std::string> getJoinedChannels() const;
bool getPassed() const;
bool getPing() const;
void clearRecvBuf();
void clearSendBuf();
int recvSocket();
int sendSocket();
};
#endif