]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_regex_tre.cpp
Tidy up keywords on module methods.
[user/henk/code/inspircd.git] / src / modules / extra / m_regex_tre.cpp
index 4b9eab472266c0dece1e10e683979981bdd9865a..0718e5bb10f05981cd6b48ad19ad7d5b8a169419 100644 (file)
 
 
 #include "inspircd.h"
-#include "m_regex.h"
+#include "modules/regex.h"
 #include <sys/types.h>
 #include <tre/regex.h>
 
 /* $ModDesc: Regex Provider Module for TRE Regular Expressions */
 /* $CompileFlags: pkgconfincludes("tre","tre/regex.h","") */
 /* $LinkerFlags: pkgconflibs("tre","/libtre.so","-ltre") rpath("pkg-config --libs tre") */
-/* $ModDep: m_regex.h */
+/* $ModDep: modules/regex.h */
 
 class TRERegexException : public ModuleException
 {
-public:
+ public:
        TRERegexException(const std::string& rx, const std::string& error)
                : ModuleException("Error in regex " + rx + ": " + error)
        {
@@ -39,7 +39,6 @@ public:
 
 class TRERegex : public Regex
 {
-private:
        regex_t regbuf;
 
 public:
@@ -64,12 +63,12 @@ public:
                }
        }
 
-       virtual ~TRERegex()
+       ~TRERegex()
        {
                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)
                {
@@ -80,7 +79,8 @@ public:
        }
 };
 
-class TREFactory : public RegexFactory {
+class TREFactory : public RegexFactory
+{
  public:
        TREFactory(Module* m) : RegexFactory(m, "regex/tre") {}
        Regex* Create(const std::string& expr)
@@ -92,18 +92,16 @@ class TREFactory : public RegexFactory {
 class ModuleRegexTRE : public Module
 {
        TREFactory trf;
-public:
-       ModuleRegexTRE() : trf(this) {
-               ServerInstance->Modules->AddService(trf);
-       }
 
-       Version GetVersion()
+ public:
+       ModuleRegexTRE() : trf(this)
        {
-               return Version("Regex Provider Module for TRE Regular Expressions", VF_VENDOR);
+               ServerInstance->Modules->AddService(trf);
        }
 
-       ~ModuleRegexTRE()
+       Version GetVersion() CXX11_OVERRIDE
        {
+               return Version("Regex Provider Module for TRE Regular Expressions", VF_VENDOR);
        }
 };