Ignore Class Reference

Manage ignores. More...

#include <ignore.h>

Inheritance diagram for Ignore:

Plugin

List of all members.

Public Member Functions

 Ignore (BotKernel *)
 Constructor.
void addIgnore (string, string, unsigned int)
 Add a host to the ignore list.
bool delIgnore (unsigned int)
 Remove a host from ignore list.
bool isIgnored (string)
 Tell if a host is ignored.
vector< string > getIgnoreList ()
 Return the ignore list.
void purifyList ()
 Clear the XML file from out dated ignores.

Private Member Functions

void initFile ()
 Initialize the XML file.

Private Attributes

TiXmlDocument * doc
 Represent the xml document.
TiXmlNode * root
 Represent documents's root.


Detailed Description

Manage ignores.

This class provides an ignore system that allow the bot to ignore users

Definition at line 51 of file ignore.h.


Constructor & Destructor Documentation

Ignore::Ignore ( BotKernel b  ) 


Member Function Documentation

void Ignore::addIgnore ( string  mask,
string  by,
unsigned int  duration 
)

Add a host to the ignore list.

Add a host to the ignore list

Parameters:
mask mask to ignore
by User mask that add the ignore
duration Ignore duration (in seconsd)

Definition at line 76 of file ignore.cpp.

References doc, root, and Tools::to_lower().

Referenced by addIgnore().

bool Ignore::delIgnore ( unsigned int  index  ) 

Remove a host from ignore list.

Del a host from the ignore list

Parameters:
index Ignore index

Definition at line 96 of file ignore.cpp.

References doc.

Referenced by delIgnore().

vector< string > Ignore::getIgnoreList (  ) 

Return the ignore list.

Give the ignore list

Returns:
A vector containing ignored hosts

Definition at line 136 of file ignore.cpp.

References Tools::intToStr(), root, and Tools::strToInt().

Referenced by ignoreList().

void Ignore::initFile (  )  [private]

Initialize the XML file.

Initilaize the XML file by creating root and first childs (file empty structure)

Definition at line 62 of file ignore.cpp.

References doc, and root.

Referenced by Ignore().

bool Ignore::isIgnored ( string  host  ) 

Tell if a host is ignored.

Check if a host is ignored

Parameters:
host Host to check
Returns:
true if ignored, else false

Definition at line 117 of file ignore.cpp.

References Tools::ircMaskMatch(), root, and Tools::to_lower().

Referenced by isIgnored(), and testIgnoredUser().

void Ignore::purifyList (  ) 

Clear the XML file from out dated ignores.

Clear ignore list from outdated ignores

Definition at line 164 of file ignore.cpp.

References doc, root, and Tools::strToInt().

Referenced by purifyList().


Member Data Documentation

TiXmlDocument* Ignore::doc [private]

Represent the xml document.

Definition at line 55 of file ignore.h.

Referenced by addIgnore(), delIgnore(), Ignore(), initFile(), and purifyList().

TiXmlNode* Ignore::root [private]

Represent documents's root.

Definition at line 57 of file ignore.h.

Referenced by addIgnore(), getIgnoreList(), Ignore(), initFile(), isIgnored(), and purifyList().


The documentation for this class was generated from the following files:

Generated on Sun Aug 16 15:28:42 2009 for trustyRC by  doxygen 1.5.8