anope- supernets anope source code & configuration |
git clone git://git.acid.vegas/anope.git |
Log | Files | Refs | Archive | README |
bs_badwords.h (1489B)
1 /* BotServ core functions 2 * 3 * (C) 2003-2022 Anope Team 4 * Contact us at team@anope.org 5 * 6 * Please read COPYING and README for further details. 7 * 8 * Based on the original code of Epona by Lara. 9 * Based on the original code of Services by Andy Church. 10 */ 11 12 /** Flags for badwords 13 */ 14 enum BadWordType 15 { 16 /* Always kicks if the word is said */ 17 BW_ANY, 18 /* User must way the entire word */ 19 BW_SINGLE, 20 /* The word has to start with the badword */ 21 BW_START, 22 /* The word has to end with the badword */ 23 BW_END 24 }; 25 26 /* Structure used to contain bad words. */ 27 struct BadWord 28 { 29 Anope::string chan; 30 Anope::string word; 31 BadWordType type; 32 33 virtual ~BadWord() { } 34 protected: 35 BadWord() { } 36 }; 37 38 struct BadWords 39 { 40 virtual ~BadWords() { } 41 42 /** Add a badword to the badword list 43 * @param word The badword 44 * @param type The type (SINGLE START END) 45 * @return The badword 46 */ 47 virtual BadWord* AddBadWord(const Anope::string &word, BadWordType type) = 0; 48 49 /** Get a badword structure by index 50 * @param index The index 51 * @return The badword 52 */ 53 virtual BadWord* GetBadWord(unsigned index) const = 0; 54 55 /** Get how many badwords are on this channel 56 * @return The number of badwords in the vector 57 */ 58 virtual unsigned GetBadWordCount() const = 0; 59 60 /** Remove a badword 61 * @param index The index of the badword 62 */ 63 virtual void EraseBadWord(unsigned index) = 0; 64 65 /** Clear all badwords from the channel 66 */ 67 virtual void ClearBadWords() = 0; 68 69 virtual void Check() = 0; 70 };