class Ban

Keep data for a channel ban. More...

Definition#include <Channel.h>
List of all Methods
Annotated List

Public Methods

Public Static Methods

Detailed Description

Class Ban represents a ban on an IRC channel. It is intended to be kept in a channel banlist.

Ban (const QString& mask,const QString& nick,const QDateTime& timestamp)

Create a new ban object with the specified attributes.

maskThe host mask of the ban.
nickThe nick or server who set the ban
timestampA QDateTime object representing the time on which the ban was set.

const QString& getMask ()

Get the host mask of the ban object.

Returns: A string containing the mask the ban was set on.

const QString& getSetBy ()

Get the name of the user/server who set the ban.

Returns: A string containing the nick of the user who set the ban, or the name of the server, in case of a server ban.

const QDateTime& getTimeStamp ()

Get the date and time on which the ban was set.

Returns: A QDateTime object initialized to the date and time the ban was set on.

bool matches (const QString& mask)

Determine wether the specified mask matches the ban.

maskThe mask to check against the internal banmask.

Returns: true if the ban matches the mask, false otherwise.

bool match (const QString& str,const QString& mask)

Determine if a specifed mask matches a string. This is a static method, and can therefore be used as Ban::match() from anywhere.

strThe full string to match against the mask (the non-wildcarded one)
maskThe mask to check the string against (usually wildcarded)

Returns: true if the string matches the mask, false otherwise.