Repository navigation
Expand file tree
/
Copy pathclient.hpp
More file actions
68 lines (59 loc) · 2.29 KB
/
Copy pathclient.hpp
File metadata and controls
68 lines (59 loc) · 2.29 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* client.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cnascime <cnascime@student.42.rio> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/23 11:52:38 by cnascime #+# #+# */
/* Updated: 2025/02/11 11:26:10 by cnascime ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef CLIENT_HPP
# define CLIENT_HPP
#include <iostream>
#include <vector>
class Server;
class Channel;
class Client {
private:
int fd_;
std::string login_;
std::string displayname_;
std::string ip_;
bool online_status_;
// Indicates whether the client is an operator (admin).
bool privileged_status_;
bool registration_status_;
std::string buffer_;
// Names of channels for which this client has been invited.
std::vector<std::string> invitations_;
public:
Client(void);
Client(std::string displayname, std::string login, int fd);
Client(Client const ©);
Client &operator=(Client const ©);
~Client(void);
int get_fd(void);
std::string get_login(void);
std::string get_displayname(void);
std::string get_ip(void);
bool isonline(void);
bool isprivileged(void);
bool isregistered(void);
std::string get_buffer(void);
bool get_invitation_status(std::string &channel_name);
std::string get_hostname(void);
void set_fd(int fd);
void set_login(std::string &login);
void set_displayname(std::string &displayname);
void set_ip(std::string ip);
void set_online_status(bool online);
void set_privileged_status(bool privileged);
void set_registration_status(bool registered);
void set_buffer(std::string received_data);
void invite_to_channel(std::string &channel_name);
void undo_invitation(std::string &channel_name);
void clear_buffer(void);
};
#endif