X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_regex_tre.cpp;h=0718e5bb10f05981cd6b48ad19ad7d5b8a169419;hb=4ab1c43c1eee708fc50a4808f714a731891b75e8;hp=9693d12580ab020f8ce69d74a63d6bedbba16b0e;hpb=46a39046196f55b52336e19662bb7bac85b731ac;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_regex_tre.cpp b/src/modules/extra/m_regex_tre.cpp index 9693d1258..0718e5bb1 100644 --- a/src/modules/extra/m_regex_tre.cpp +++ b/src/modules/extra/m_regex_tre.cpp @@ -19,27 +19,26 @@ #include "inspircd.h" -#include "m_regex.h" +#include "modules/regex.h" #include #include /* $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(std::string("Error in regex ") + rx + ": " + error) + : ModuleException("Error in regex " + rx + ": " + error) { } }; class TRERegex : public Regex { -private: regex_t regbuf; public: @@ -64,12 +63,12 @@ public: } } - virtual ~TRERegex() + ~TRERegex() { regfree(®buf); } - virtual bool Matches(const std::string& text) + bool Matches(const std::string& text) { if (regexec(®buf, 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); } };