-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUser.hpp
More file actions
65 lines (54 loc) · 1.58 KB
/
User.hpp
File metadata and controls
65 lines (54 loc) · 1.58 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
#pragma once
# include <list>
# include <string>
# include "Channel.hpp"
class Server;
class User
{
public:
typedef std::list<Channel *>::iterator iterator;
private:
int _socket;
int _hopcount;
std::string _nickname;
std::string _username;
std::string _realname;
std::string _hostname;
bool _password;
bool _isOP;
bool _isWelcomed;
std::list<Channel*> _joinedChannels;
public:
// Constructor + Destructor
User(int fd);
~User(void);
User(void);
User(const User & other);
User &operator=(const User &rhs);
User *clone(void) const;
// Getters + Setters
int getSocket() const;
int getHopcount() const;
std::string getNickname() const;
std::string getUsername() const;
std::string getRealname() const;
std::string getHostname() const;
bool getIsOP() const;
bool isWelcomed() const;
bool getPassword() const;
void setHopcount(int hopcount);
void setNickname(std::string nickname);
void setIsOP(bool OP);
void setWelcomed(bool is_it);
void setUsername(std::string username);
void setRealname(std::string realname);
void setPassword(bool pass);
void addChannel(Channel *chann);
Channel *getChannelName(const std::string &str);
std::list <Channel *> &getListChannels(void);
void deleteChannel(const std::string &name);
//métodos de enviar a secas a otros sockets, comprobando channels
// void message(Server &serv, const char *buff, int nbytes);
bool is_in_channel(Channel *chan);
};
# include "Server.hpp"