#include <channel.h>
Public Member Functions | |
Channel (string) | |
Constructor. | |
~Channel () | |
Destructor. | |
string | getName () |
return the channel name | |
bool | addUser (string, string, string, string) |
Add a user to the chan. | |
bool | delUserByNick (string) |
Del a user from the chan. | |
bool | delUserByHost (string) |
Del a user from the chan. | |
string * | getInfosByNick (string) |
Return infos about a user. | |
string | getNickByHost (string) |
Return the nick associated to a given host. | |
string | getStatusByNick (string) |
Return the status associated to a given nick. | |
string | getStatusByHost (string) |
Return the status associated to a given host. | |
string | getHostByNick (string) |
Return the host associated to a given nick. | |
string | getIdentByNick (string) |
Return the ident associated to a nick. | |
string | getIdentByHost (string) |
Return the ident associated to a host. | |
bool | setNickByNick (string, string) |
Change a nick. | |
bool | setNickByHost (string, string) |
Change the nick associated to a host. | |
bool | updateStatusByNick (string, char, char) |
Update the status associated to a nick. | |
bool | checkNickAccess (string, char) |
Check if a nick owns a given access. | |
void | truncateUsersList () |
Erase all users from the channel. | |
vector< string * > | getUsers () |
Gives users vector. | |
time_t | getLastWhoUpdate () |
Get last update. | |
void | notifyWho () |
Notify a WHO update. | |
string | getTopic () |
get topic | |
void | setTopic (string) |
set topic | |
string * | getLastPartInfos () |
get informations about the last user who left channel | |
bool | isOnChannel (string) |
Tell if a nick is on the channel. | |
Private Member Functions | |
vector< string * >::iterator | getIterator (string, unsigned int) |
Return a nick iterator in a vector. | |
Private Attributes | |
vector< string * > | users |
Contain all the chan users. | |
string | name |
Channel name. | |
time_t | lastWhoUpdate |
Keep last WHO update. | |
string | topic |
stores channel's topic | |
string | lastPart [4] |
Stores informations about the last user who left channel. |
This class stores and manage all informations about a channel
Definition at line 44 of file channel.h.
Channel::Channel | ( | string | name | ) |
Constructor.
Class constructor Initialize private attributes
name | Channel name |
Definition at line 36 of file channel.cpp.
References lastPart, lastWhoUpdate, topic, and users.
Channel::~Channel | ( | ) |
Destructor.
Destructor Clear private attributes
Definition at line 51 of file channel.cpp.
References truncateUsersList().
bool Channel::addUser | ( | string | nick, | |
string | host, | |||
string | ident, | |||
string | status | |||
) |
Add a user to the chan.
Add a user to the channel It's then possible to follow status
nick | User nick | |
host | User host | |
ident | User ident | |
status | User status |
Definition at line 74 of file channel.cpp.
References getHostByNick(), and users.
bool Channel::checkNickAccess | ( | string | nick, | |
char | access | |||
) |
Check if a nick owns a given access.
Check if a given nick owns a given access
nick | The nick witch you want to check access | |
access | Access to test (o,v,etc ...) |
Definition at line 347 of file channel.cpp.
References getIterator(), and users.
bool Channel::delUserByHost | ( | string | host | ) |
Del a user from the chan.
Del a user from the chan according to a given host
host | host's user to delete |
Definition at line 140 of file channel.cpp.
References getIterator(), lastPart, and users.
bool Channel::delUserByNick | ( | string | nick | ) |
Del a user from the chan.
Del a user from the chan according to a given nick
nick | Nick to delete |
Definition at line 118 of file channel.cpp.
References getIterator(), lastPart, and users.
string Channel::getHostByNick | ( | string | nick | ) |
Return the host associated to a given nick.
Give the host corresponding to a given nick
nick | nick from witch you want to get the host |
Definition at line 224 of file channel.cpp.
References getIterator(), and users.
Referenced by addUser().
string Channel::getIdentByHost | ( | string | host | ) |
Return the ident associated to a host.
Give the host corresponding to a given host
host | host from witch you want to get the ident |
Definition at line 254 of file channel.cpp.
References getIterator(), and users.
string Channel::getIdentByNick | ( | string | nick | ) |
Return the ident associated to a nick.
Give the ident corresponding to a given nick
nick | nick from witch you want to get the ident |
Definition at line 239 of file channel.cpp.
References getIterator(), and users.
string * Channel::getInfosByNick | ( | string | nick | ) |
Return infos about a user.
Return informations about a nick, in this order : tab[0]=nick; tab[1]=host; tab[2]=ident; tab[3]=status;
nick | User nick |
Definition at line 178 of file channel.cpp.
References getIterator(), and users.
Referenced by isOnChannel().
vector< string * >::iterator Channel::getIterator | ( | string | comparator, | |
unsigned int | index | |||
) | [private] |
Return a nick iterator in a vector.
Return a vector iterator according to arguments
comparator | String to compair with the vector | |
index | User's infos index |
Definition at line 96 of file channel.cpp.
References users.
Referenced by checkNickAccess(), delUserByHost(), delUserByNick(), getHostByNick(), getIdentByHost(), getIdentByNick(), getInfosByNick(), getNickByHost(), getStatusByHost(), getStatusByNick(), setNickByHost(), setNickByNick(), and updateStatusByNick().
string * Channel::getLastPartInfos | ( | ) |
get informations about the last user who left channel
Returns informations about the last user who left the channel
Definition at line 434 of file channel.cpp.
References lastPart.
time_t Channel::getLastWhoUpdate | ( | ) |
Get last update.
Get last WHO update timestamp
Definition at line 399 of file channel.cpp.
References lastWhoUpdate.
string Channel::getName | ( | ) |
return the channel name
Get channel name
Definition at line 60 of file channel.cpp.
References name.
string Channel::getNickByHost | ( | string | host | ) |
Return the nick associated to a given host.
Give the nick corresponding to a given host
host | host from witch you want to get the nick |
Definition at line 160 of file channel.cpp.
References getIterator(), and users.
string Channel::getStatusByHost | ( | string | host | ) |
Return the status associated to a given host.
Give the status corresponding to a given host
host | host from witch you want to get the status |
Definition at line 209 of file channel.cpp.
References getIterator(), and users.
string Channel::getStatusByNick | ( | string | nick | ) |
Return the status associated to a given nick.
Give the status corresponding to a given nick
nick | Nick from witch you want to get the status |
Definition at line 194 of file channel.cpp.
References getIterator(), and users.
string Channel::getTopic | ( | ) |
vector< string * > Channel::getUsers | ( | ) |
Gives users vector.
Return users vector informations Users a stored in a string tab like that : tab[0]=nick; tab[1]=host; tab[2]=ident; tab[3]=status;
Definition at line 390 of file channel.cpp.
References users.
bool Channel::isOnChannel | ( | string | nick | ) |
Tell if a nick is on the channel.
Tell if a nick is on the channel
nick | Nick to check |
Definition at line 444 of file channel.cpp.
References getInfosByNick().
void Channel::notifyWho | ( | ) |
Notify a WHO update.
Notify that a a WHO command has been sent for this channel
Definition at line 407 of file channel.cpp.
References lastWhoUpdate.
bool Channel::setNickByHost | ( | string | host, | |
string | newnick | |||
) |
Change the nick associated to a host.
Change a user nick to an other one This one is found by the host
host | User host for witch you want to change the nick | |
newnick | New nick (instead of old one) |
Definition at line 289 of file channel.cpp.
References getIterator(), and users.
bool Channel::setNickByNick | ( | string | old, | |
string | newnick | |||
) |
Change a nick.
Change a user nick to an other one This one is found by the nick
old | Nick to change | |
newnick | New nick (instead of old one) |
Definition at line 271 of file channel.cpp.
References getIterator(), and users.
void Channel::setTopic | ( | string | topic | ) |
void Channel::truncateUsersList | ( | ) |
Erase all users from the channel.
Clear users list
Definition at line 371 of file channel.cpp.
References users.
Referenced by ~Channel().
bool Channel::updateStatusByNick | ( | string | nick, | |
char | sign, | |||
char | mode | |||
) |
Update the status associated to a nick.
Change a user status to an other one This one is found by the nick
nick | User nick for witch you want to change the status | |
sign | + or - (+ for grant level, - for remove level) | |
mode | user mode (v,o etc ...) |
Definition at line 308 of file channel.cpp.
References getIterator(), and users.
string Channel::lastPart[4] [private] |
Stores informations about the last user who left channel.
Definition at line 109 of file channel.h.
Referenced by Channel(), delUserByHost(), delUserByNick(), and getLastPartInfos().
time_t Channel::lastWhoUpdate [private] |
Keep last WHO update.
Definition at line 105 of file channel.h.
Referenced by Channel(), getLastWhoUpdate(), and notifyWho().
string Channel::name [private] |
string Channel::topic [private] |
stores channel's topic
Definition at line 107 of file channel.h.
Referenced by Channel(), and getTopic().
vector<string*> Channel::users [private] |
Contain all the chan users.
Definition at line 99 of file channel.h.
Referenced by addUser(), Channel(), checkNickAccess(), delUserByHost(), delUserByNick(), getHostByNick(), getIdentByHost(), getIdentByNick(), getInfosByNick(), getIterator(), getNickByHost(), getStatusByHost(), getStatusByNick(), getUsers(), setNickByHost(), setNickByNick(), truncateUsersList(), and updateStatusByNick().