#include <lists.h>
Inherited by AkillDelCallback, BadwordsDelCallback, ExceptionDelCallback, MemoDelCallback, MemoListCallback, and SXLineDelCallback.
Public Member Functions | |
| NumberList (const Anope::string &list, bool descending) | |
| virtual | ~NumberList () |
| void | Process () |
| virtual void | HandleNumber (unsigned number) |
| virtual bool | InvalidRange (const Anope::string &list) |
Private Attributes | |
| bool | is_valid |
| std::set< unsigned > | numbers |
| bool | desc |
A class to process numbered lists (passed to most DEL/LIST/VIEW commands). The function HandleNumber is called for every number in the list. Note that if descending is true it gets called in descending order. This is so deleting the index passed to the function from an array will not cause the other indexes passed to the function to be incorrect. This keeps us from having to have an 'in use' flag on everything.
Definition at line 26 of file lists.h.
| NumberList::NumberList | ( | const Anope::string & | list, | |
| bool | descending | |||
| ) |
Processes a numbered list
| list | The list | |
| descending | True to make HandleNumber get called with numbers in descending order |
Definition at line 31 of file misc.cpp.
References Anope::string::empty(), Anope::string::find(), sepstream::GetToken(), InvalidRange(), is_valid, Anope::string::npos, numbers, and Anope::string::substr().
| NumberList::~NumberList | ( | ) | [virtual] |
| void NumberList::HandleNumber | ( | unsigned | number | ) | [virtual] |
Called with a number from the list
| number | The number |
Reimplemented in BadwordsDelCallback, MemoDelCallback, MemoListCallback, AkillDelCallback, ExceptionDelCallback, and SXLineDelCallback.
Definition at line 101 of file misc.cpp.
Referenced by Process().
| bool NumberList::InvalidRange | ( | const Anope::string & | list | ) | [virtual] |
Called when there is an error with the numbered list Return false to immediatly stop processing the list and return This is all done before we start calling HandleNumber, so no numbers will have been processed yet
| list | The list |
Definition at line 105 of file misc.cpp.
Referenced by NumberList().
| void NumberList::Process | ( | ) |
Should be called after the constructors are done running. This calls the callbacks.
Definition at line 84 of file misc.cpp.
References desc, HandleNumber(), is_valid, and numbers.
Referenced by CommandOSException::DoDel(), CommandOSAKill::DoDel(), CommandBSBadwords::DoDelete(), CommandMSRead::Execute(), CommandMSDel::Execute(), and CommandOSSXLineBase::OnDel().
bool NumberList::desc [private] |
bool NumberList::is_valid [private] |
Definition at line 29 of file lists.h.
Referenced by NumberList(), and Process().
std::set<unsigned> NumberList::numbers [private] |
Definition at line 31 of file lists.h.
Referenced by NumberList(), and Process().
1.7.1