The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ModuleFilterPCRE Class Reference

Inheritance diagram for ModuleFilterPCRE:

Inheritance graph
[legend]
Collaboration diagram for ModuleFilterPCRE:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleFilterPCRE (InspIRCd *Me)
virtual ~ModuleFilterPCRE ()
virtual FilterResultFilterMatch (User *user, const std::string &text, int flgs)
virtual bool DeleteFilter (const std::string &freeform)
virtual void SyncFilters (Module *proto, void *opaque)
virtual std::pair< bool, std::stringAddFilter (const std::string &freeform, const std::string &type, const std::string &reason, long duration, const std::string &flgs)
virtual void OnRehash (User *user, const std::string &parameter)
 Called on rehash.
virtual int OnStats (char symbol, User *user, string_list &results)
 Called on all /STATS commands This method is triggered for all /STATS use, including stats symbols handled by the core.

Private Attributes

std::vector< PCREFilterfilters
pcre * re
const char * error
int erroffset
PCREFilter fr

Detailed Description

Definition at line 45 of file m_filter_pcre.cpp.


Constructor & Destructor Documentation

ModuleFilterPCRE::ModuleFilterPCRE InspIRCd Me  )  [inline]
 

Definition at line 54 of file m_filter_pcre.cpp.

References OnRehash().

virtual ModuleFilterPCRE::~ModuleFilterPCRE  )  [inline, virtual]
 

Definition at line 61 of file m_filter_pcre.cpp.


Member Function Documentation

virtual std::pair<bool, std::string> ModuleFilterPCRE::AddFilter const std::string freeform,
const std::string type,
const std::string reason,
long  duration,
const std::string flgs
[inline, virtual]
 

Implements FilterBase.

Definition at line 110 of file m_filter_pcre.cpp.

References ConvToStr(), DEFAULT, erroffset, error, filters, LogManager::Log(), InspIRCd::Logs, re, and Module::ServerInstance.

virtual bool ModuleFilterPCRE::DeleteFilter const std::string freeform  )  [inline, virtual]
 

Implements FilterBase.

Definition at line 88 of file m_filter_pcre.cpp.

References filters.

Referenced by OnRehash().

virtual FilterResult* ModuleFilterPCRE::FilterMatch User user,
const std::string text,
int  flgs
[inline, virtual]
 

Implements FilterBase.

Definition at line 65 of file m_filter_pcre.cpp.

References FilterBase::AppliesToMe(), filters, and fr.

virtual void ModuleFilterPCRE::OnRehash User user,
const std::string parameter
[inline, virtual]
 

Called on rehash.

This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application. If a parameter is given, the core has done nothing. The module receiving the event can decide if this parameter has any relevence to it.

Parameters:
user The user performing the rehash, if any -- if this is server initiated, the value of this variable will be NULL.
parameter The (optional) parameter given to REHASH from the user.

Reimplemented from FilterBase.

Definition at line 135 of file m_filter_pcre.cpp.

References DEFAULT, DeleteFilter(), InspIRCd::Duration(), ConfigReader::Enumerate(), erroffset, error, filters, LogManager::Log(), InspIRCd::Logs, FilterBase::OnRehash(), re, ConfigReader::ReadValue(), and Module::ServerInstance.

Referenced by ModuleFilterPCRE().

virtual int ModuleFilterPCRE::OnStats char  symbol,
User user,
string_list results
[inline, virtual]
 

Called on all /STATS commands This method is triggered for all /STATS use, including stats symbols handled by the core.

Parameters:
symbol the symbol provided to /STATS
user the user issuing the /STATS command
results A string_list to append results into. You should put all your results into this string_list, rather than displaying them directly, so that your handler will work when remote STATS queries are received.
Returns:
1 to block the /STATS from being processed by the core, 0 to allow it

Implements FilterBase.

Definition at line 169 of file m_filter_pcre.cpp.

References InspIRCd::Config, ConvToStr(), FilterBase::exemptfromfilter, filters, User::nick, Module::ServerInstance, and ServerConfig::ServerName.

virtual void ModuleFilterPCRE::SyncFilters Module proto,
void *  opaque
[inline, virtual]
 

Implements FilterBase.

Definition at line 102 of file m_filter_pcre.cpp.

References filters, and FilterBase::SendFilter().


Member Data Documentation

int ModuleFilterPCRE::erroffset [private]
 

Definition at line 50 of file m_filter_pcre.cpp.

Referenced by AddFilter(), and OnRehash().

const char* ModuleFilterPCRE::error [private]
 

Definition at line 49 of file m_filter_pcre.cpp.

Referenced by AddFilter(), and OnRehash().

std::vector<PCREFilter> ModuleFilterPCRE::filters [private]
 

Definition at line 47 of file m_filter_pcre.cpp.

Referenced by AddFilter(), DeleteFilter(), FilterMatch(), OnRehash(), OnStats(), and SyncFilters().

PCREFilter ModuleFilterPCRE::fr [private]
 

Definition at line 51 of file m_filter_pcre.cpp.

Referenced by FilterMatch().

pcre* ModuleFilterPCRE::re [private]
 

Definition at line 48 of file m_filter_pcre.cpp.

Referenced by AddFilter(), and OnRehash().


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