#include <advertising.h>

Public Member Functions | |
| Advertising (BotKernel *) | |
| Constructor. | |
| time_t | addAdvertise (string, unsigned int, unsigned int, string, string) |
| Add an advertise to the advertise list. | |
| bool | delAdvertise (string) |
| Delete an advertise from the file. | |
| bool | adExists (string) |
| Tell if an advertise exists. | |
| vector< string > | getAdvertiseInfos (string) |
| Get advertise infos. | |
| vector< string > | getAdvertisesList () |
| Get advertises list. | |
| void | deleteOutdatedAds () |
| Delete outdated ads. | |
| void | launchAdvertise (BotKernel *, string, unsigned int) |
| launch an add | |
Private Member Functions | |
| void | initFile () |
| Initialize the XML file. | |
Private Attributes | |
| TiXmlDocument * | doc |
| Represent the xml document. | |
| TiXmlNode * | root |
| Represent documents's root. | |
This plugin makes the bot display ads on channels
Definition at line 51 of file advertising.h.
| Advertising::Advertising | ( | BotKernel * | b | ) |
Constructor.
Constructor
Definition at line 36 of file advertising.cpp.
References Plugin::addRequirement(), Plugin::author, Plugin::bindFunction(), Plugin::description, doc, BotKernel::getDatasDir(), IN_COMMAND_HANDLER, IN_LOOP, initFile(), launchAdvertise(), Plugin::name, root, Tools::strToInt(), and Plugin::version.
| time_t Advertising::addAdvertise | ( | string | channel, | |
| unsigned int | frequency, | |||
| unsigned int | until, | |||
| string | by, | |||
| string | text | |||
| ) |
Add an advertise to the advertise list.
Add an advertising to a channel, and save it int the XML file
| channel | Ad's channel | |
| frequency | Ad's frequency (in seconds) | |
| until | Number (in seconds) after witch the ad is outdated | |
| by | User who add the ad | |
| text | Ad's text |
Definition at line 97 of file advertising.cpp.
References adExists(), doc, Tools::intToStr(), and root.
Referenced by addad().
| bool Advertising::adExists | ( | string | id | ) |
Tell if an advertise exists.
Tell if an ad exists
| id | Ad's id |
Definition at line 148 of file advertising.cpp.
References doc.
Referenced by addAdvertise().
| bool Advertising::delAdvertise | ( | string | id | ) |
Delete an advertise from the file.
Delete an advertise from the XML file
| id | Ad's id |
Definition at line 128 of file advertising.cpp.
References doc.
Referenced by delad().
| void Advertising::deleteOutdatedAds | ( | ) |
Delete outdated ads.
Delete outdated ads
Definition at line 208 of file advertising.cpp.
References doc, and Tools::strToInt().
Referenced by cleanList().
| vector< string > Advertising::getAdvertiseInfos | ( | string | id | ) |
Get advertise infos.
Get advertise infos. Infos are :
| id | Ad's id |
Definition at line 169 of file advertising.cpp.
References doc.
Referenced by adinfos(), and displayAdvertise().
| vector< string > Advertising::getAdvertisesList | ( | ) |
Get advertises list.
Get advertises list
Definition at line 190 of file advertising.cpp.
References doc, and Tools::strToInt().
Referenced by listads().
| void Advertising::initFile | ( | ) | [private] |
Initialize the XML file.
Initilaize the XML file by creating root and first childs (file empty structure)
Definition at line 68 of file advertising.cpp.
Referenced by Advertising().
| void Advertising::launchAdvertise | ( | BotKernel * | b, | |
| string | id, | |||
| unsigned int | freq | |||
| ) |
launch an add
Launch an add
| b | Kernel pointer | |
| id | Ad's id | |
| freq | Ad's display frequency |
Definition at line 82 of file advertising.cpp.
References BotKernel::addCountDown(), and displayAdvertise().
Referenced by Advertising().
TiXmlDocument* Advertising::doc [private] |
Represent the xml document.
Definition at line 55 of file advertising.h.
Referenced by addAdvertise(), adExists(), Advertising(), delAdvertise(), deleteOutdatedAds(), getAdvertiseInfos(), getAdvertisesList(), and initFile().
TiXmlNode* Advertising::root [private] |
Represent documents's root.
Definition at line 57 of file advertising.h.
Referenced by addAdvertise(), Advertising(), and initFile().
1.5.7.1