* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
class GlobRegex : public Regex
{
public:
- GlobRegex(const std::string& rx, InspIRCd* Me) : Regex(rx, Me)
+ GlobRegex(const std::string& rx) : Regex(rx)
{
}
virtual bool Matches(const std::string& text)
{
- return InspIRCd::Match(this->regex_string, text);
+ return InspIRCd::Match(text, this->regex_string);
}
};
class ModuleRegexGlob : public Module
{
public:
- ModuleRegexGlob(InspIRCd* Me) : Module(Me)
- {
- Me->Modules->PublishInterface("RegularExpression", this);
+ ModuleRegexGlob() {
+ ServerInstance->Modules->PublishInterface("RegularExpression", this);
Implementation eventlist[] = { I_OnRequest };
- Me->Modules->Attach(eventlist, this, 1);
+ ServerInstance->Modules->Attach(eventlist, this, 1);
}
virtual Version GetVersion()
{
- return Version("$Id$", VF_COMMON | VF_VENDOR | VF_SERVICEPROVIDER, API_VERSION);
+ return Version("Regex module using plain wildcard matching.", VF_COMMON | VF_VENDOR | VF_SERVICEPROVIDER, API_VERSION);
}
virtual ~ModuleRegexGlob()
{
RegexFactoryRequest* rfr = (RegexFactoryRequest*)request;
std::string rx = rfr->GetRegex();
- rfr->result = (Regex*)new GlobRegex(rx, ServerInstance);
+ rfr->result = new GlobRegex(rx);
return "OK";
}
return NULL;