X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_regex.h;h=0233f938a6ba38de9b153a3ebd1d89bcb1f8a9ac;hb=571714e28b26cc59cbc8d27098a5ba981240ee2d;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..0233f938a 100644 --- a/src/modules/m_regex.h +++ b/src/modules/m_regex.h @@ -1,18 +1,25 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2008 Thomas Stagner * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -#ifndef _M_REGEX_H -#define _M_REGEX_H + +#ifndef M_REGEX_H +#define M_REGEX_H #include "inspircd.h" @@ -20,10 +27,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 +47,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) - { - } - - const std::string& GetRegex() const - { - return regex; - } + public: + RegexFactory(Module* Creator, const std::string& Name) : DataProvider(Creator, Name) {} - 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