]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_regex_posix.cpp
Tidy up keywords on module methods.
[user/henk/code/inspircd.git] / src / modules / extra / m_regex_posix.cpp
index b3afd60c80b8c002ebdaa21eae3069690a775ab2..dbbc990b9ad106ee484513fd15941f6105e75a5f 100644 (file)
 
 
 #include "inspircd.h"
-#include "m_regex.h"
+#include "modules/regex.h"
 #include <sys/types.h>
 #include <regex.h>
 
 /* $ModDesc: Regex Provider Module for POSIX Regular Expressions */
-/* $ModDep: m_regex.h */
+/* $ModDep: modules/regex.h */
 
 class POSIXRegexException : public ModuleException
 {
-public:
+ public:
        POSIXRegexException(const std::string& rx, const std::string& error)
                : ModuleException("Error in regex " + rx + ": " + error)
        {
@@ -37,10 +37,9 @@ public:
 
 class POSIXRegex : public Regex
 {
-private:
        regex_t regbuf;
 
-public:
+ public:
        POSIXRegex(const std::string& rx, bool extended) : Regex(rx)
        {
                int flags = (extended ? REG_EXTENDED : 0) | REG_NOSUB;
@@ -62,12 +61,12 @@ public:
                }
        }
 
-       virtual ~POSIXRegex()
+       ~POSIXRegex()
        {
                regfree(&regbuf);
        }
 
-       virtual bool Matches(const std::string& text)
+       bool Matches(const std::string& text)
        {
                if (regexec(&regbuf, text.c_str(), 0, NULL, 0) == 0)
                {
@@ -92,20 +91,22 @@ class PosixFactory : public RegexFactory
 class ModuleRegexPOSIX : public Module
 {
        PosixFactory ref;
-public:
-       ModuleRegexPOSIX() : ref(this) {
+
+ public:
+       ModuleRegexPOSIX() : ref(this)
+       {
                ServerInstance->Modules->AddService(ref);
                Implementation eventlist[] = { I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
                OnRehash(NULL);
        }
 
-       Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Regex Provider Module for POSIX Regular Expressions", VF_VENDOR);
        }
 
-       void OnRehash(User* u)
+       void OnRehash(User* u) CXX11_OVERRIDE
        {
                ref.extended = ServerInstance->Config->ConfValue("posix")->getBool("extended");
        }