]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_regex.h
Merge pull request #1157 from SaberUK/insp20+fix-cron-restart
[user/henk/code/inspircd.git] / src / modules / m_regex.h
index 85f52c4d877416d35fc04fb5d99e6d435217a75e..0233f938a6ba38de9b153a3ebd1d89bcb1f8a9ac 100644 (file)
@@ -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 <danieldg@inspircd.org>
+ *   Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
  *
- * 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 <http://www.gnu.org/licenses/>.
  */
 
-#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