-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathChannel.cpp
More file actions
74 lines (56 loc) · 1.13 KB
/
Channel.cpp
File metadata and controls
74 lines (56 loc) · 1.13 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
69
70
71
72
73
74
#include "Channel.hpp"
// Constructors + Destructor + '=' operator
Channel::Channel(std::string &name): _name(name) {}
Channel::~Channel() {}
Channel::Channel(const Channel & other)
{
*this = other;
}
Channel &Channel::operator=(const Channel &rhs)
{
this->_name = rhs._name;
return (*this);
}
// Functions
Channel *Channel::clone(void) const
{
return (new Channel(*this));
}
// Getters
std::string Channel::getTopic(void) const
{
return (this->_topic);
}
std::string Channel::getName(void) const
{
return (this->_name);
}
std::string Channel::getWhoTopicNick(void) const
{
return (this->_whoTopicNick);
}
std::string Channel::getWhoTopicSetat(void) const
{
return (this->_whoTopicSetat);
}
int Channel::getChanUsers() const
{
return (this->_chanusers);
}
// Setters
void Channel::setTopic(std::string topic)
{
this->_topic = topic;
}
void Channel::setWhoTopicNick(std::string str)
{
this->_whoTopicNick = str;
}
void Channel::setWhoTopicSetat(std::string str)
{
this->_whoTopicSetat = str;
}
void Channel::setChanUsers(int n)
{
(n > 0) ? this->_chanusers++ : this->_chanusers--;
}