-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.hpp
More file actions
58 lines (48 loc) · 1.24 KB
/
Client.hpp
File metadata and controls
58 lines (48 loc) · 1.24 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
#ifndef CLIENT_H
#define CLIENT_H
#include <iostream>
#include <string>
#include <set>
class Client
{
private:
int _fd;
std::string _ipAddress;
std::string _nickname;
std::string _username;
std::string _realname;
std::string _password;
std::string _buffer;
std::set<std::string> _joinedChannels; // Keep track of joined channels
bool _registered;
bool _authenticated;
public:
Client();
Client(int fd); // New constructor
Client(int fd, const std::string& address);
~Client();
// Getters
int getFd() const;
std::string getNickname() const;
std::string getUsername() const;
std::string getRealname() const;
std::string getPassword() const;
std::string getBuffer() const;
std::string &getAccumulatedBuffer() { return _buffer; }
bool isRegistered() const;
bool isAuth() const;
// Setters
void setFd(int fd);
void setIpAddress(const std::string& ip);
void setNickname(const std::string nickname);
void setUserName(const std::string username);
void setRealName(const std::string realname);
void setPassword(const std::string password);
void setBuffer(char *buf);
void delete_buffer();
void setRegistered(bool registered);
void setAuth(bool auth);
bool authenticate();
void joinChannel(const std::string& channelName);
};
#endif