X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_regex.h;h=523f9f0d32f4bbce6ca44a65feba28a0cb916a61;hb=8fa7e20b6b47d4de617e1bba2773606df569f11d;hp=85f52c4d877416d35fc04fb5d99e6d435217a75e;hpb=43847ec9c7e1a195163eb4c529f1c92fd1ace0a4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_regex.h b/src/modules/m_regex.h index 85f52c4d8..523f9f0d3 100644 --- a/src/modules/m_regex.h +++ b/src/modules/m_regex.h @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2010 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -20,10 +20,9 @@ class Regex : public classbase { protected: std::string regex_string; // The raw uncompiled regex string. - InspIRCd* ServerInstance; // Constructor may as well be protected, as this class is abstract. - Regex(const std::string& rx, InspIRCd* Me) : regex_string(rx), ServerInstance(Me) + Regex(const std::string& rx) : regex_string(rx) { } @@ -41,36 +40,12 @@ public: } }; -class RegexFactoryRequest : public Request +class RegexFactory : public DataProvider { -private: - std::string regex; - -public: - Regex* result; - - RegexFactoryRequest(Module* Me, Module* Target, const std::string& rx) : Request(Me, Target, "REGEX"), regex(rx), result(NULL) - { - } + public: + RegexFactory(Module* Creator, const std::string& Name) : DataProvider(Creator, Name) {} - const std::string& GetRegex() const - { - return regex; - } - - Regex* Create() - { - Send(); - return this->result; - } -}; - -class RegexNameRequest : public Request -{ -public: - RegexNameRequest(Module* Me, Module* Target) : Request(Me, Target, "REGEX-NAME") - { - } + virtual Regex* Create(const std::string& expr) = 0; }; #endif