]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_regex_posix.cpp
Fix the Ubuntu package name for ssl_gnutls.
[user/henk/code/inspircd.git] / src / modules / extra / m_regex_posix.cpp
index 6c52a935b6724cb65738e6f05c77d86b2762cff8..d63b83acf1d1fe31e2954228f2b6fd175a679932 100644 (file)
@@ -1,7 +1,11 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2013 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2012-2013 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
  *   Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
@@ -54,14 +58,9 @@ class POSIXRegex : public Regex
                regfree(&regbuf);
        }
 
-       bool Matches(const std::string& text)
+       bool Matches(const std::string& text) CXX11_OVERRIDE
        {
-               if (regexec(&regbuf, text.c_str(), 0, NULL, 0) == 0)
-               {
-                       // Bang. :D
-                       return true;
-               }
-               return false;
+               return (regexec(&regbuf, text.c_str(), 0, NULL, 0) == 0);
        }
 };
 
@@ -70,7 +69,7 @@ class PosixFactory : public RegexFactory
  public:
        bool extended;
        PosixFactory(Module* m) : RegexFactory(m, "regex/posix") {}
-       Regex* Create(const std::string& expr)
+       Regex* Create(const std::string& expr) CXX11_OVERRIDE
        {
                return new POSIXRegex(expr, extended);
        }
@@ -83,16 +82,14 @@ class ModuleRegexPOSIX : public Module
  public:
        ModuleRegexPOSIX() : ref(this)
        {
-               ServerInstance->Modules->AddService(ref);
-               OnRehash(NULL);
        }
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Regex Provider Module for POSIX Regular Expressions", VF_VENDOR);
+               return Version("Provides the posix regular expression engine which uses the POSIX.2 regular expression matching system.", VF_VENDOR);
        }
 
-       void OnRehash(User* u) CXX11_OVERRIDE
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ref.extended = ServerInstance->Config->ConfValue("posix")->getBool("extended");
        }