X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_regex_stdlib.cpp;h=8e7bd0da25f99375ca7ab2b5304dc44c89805aa2;hb=8320bcc9df1ea89a47257c9f9c70aa6d476beaa8;hp=5d2294c871ac2311cb11c10893b0cbdf866ea79d;hpb=fd0fa86da89ab4cefa778307088ef2552a05a170;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_regex_stdlib.cpp b/src/modules/extra/m_regex_stdlib.cpp index 5d2294c87..8e7bd0da2 100644 --- a/src/modules/extra/m_regex_stdlib.cpp +++ b/src/modules/extra/m_regex_stdlib.cpp @@ -21,16 +21,6 @@ #include /* $CompileFlags: -std=c++11 */ -/* $ModDep: modules/regex.h */ - -class StdRegexException : public ModuleException -{ - public: - StdRegexException(const std::string& rx, const std::string& error) - : ModuleException(std::string("Error in regex ") + rx + ": " + error) - { - } -}; class StdRegex : public Regex { @@ -44,11 +34,11 @@ class StdRegex : public Regex } catch(std::regex_error rxerr) { - throw StdRegexException(rx, rxerr.what()); + throw RegexException(rx, rxerr.what()); } } - bool Matches(const std::string& text) + bool Matches(const std::string& text) CXX11_OVERRIDE { return std::regex_search(text, regexcl); } @@ -59,7 +49,7 @@ class StdRegexFactory : public RegexFactory public: std::regex::flag_type regextype; StdRegexFactory(Module* m) : RegexFactory(m, "regex/stdregex") {} - Regex* Create(const std::string& expr) + Regex* Create(const std::string& expr) CXX11_OVERRIDE { return new StdRegex(expr, regextype); } @@ -71,10 +61,6 @@ public: StdRegexFactory ref; ModuleRegexStd() : ref(this) { - ServerInstance->Modules->AddService(ref); - Implementation eventlist[] = { I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); - OnRehash(NULL); } Version GetVersion() CXX11_OVERRIDE @@ -82,7 +68,7 @@ public: return Version("Regex Provider Module for std::regex", VF_VENDOR); } - void OnRehash(User* u) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* Conf = ServerInstance->Config->ConfValue("stdregex"); std::string regextype = Conf->getString("type", "ecmascript");