diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-04-01 21:56:13 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-04-01 21:56:13 +0200 |
commit | 26e7bb0b9a17a595d9935a1cae41b44504ad213e (patch) | |
tree | 904734f67485d62de90c35abbb522ad0e84cb862 /src/modules/extra/m_regex_stdlib.cpp | |
parent | 8584cc23f4bd6515acef65fc82a15dc1f53127b2 (diff) |
Whitespace and empty destructor removal, minor coding style changes
Diffstat (limited to 'src/modules/extra/m_regex_stdlib.cpp')
-rw-r--r-- | src/modules/extra/m_regex_stdlib.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/modules/extra/m_regex_stdlib.cpp b/src/modules/extra/m_regex_stdlib.cpp index 204728b65..64d479cbc 100644 --- a/src/modules/extra/m_regex_stdlib.cpp +++ b/src/modules/extra/m_regex_stdlib.cpp @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - + #include "inspircd.h" #include "m_regex.h" #include <regex> @@ -29,7 +29,7 @@ class StdRegexException : public ModuleException { -public: + public: StdRegexException(const std::string& rx, const std::string& error) : ModuleException(std::string("Error in regex ") + rx + ": " + error) { @@ -38,9 +38,9 @@ public: class StdRegex : public Regex { -private: std::regex regexcl; -public: + + public: StdRegex(const std::string& rx, std::regex::flag_type fltype) : Regex(rx) { try{ @@ -51,7 +51,7 @@ public: throw StdRegexException(rx, rxerr.what()); } } - + virtual bool Matches(const std::string& text) { return std::regex_search(text, regexcl); @@ -73,7 +73,8 @@ class ModuleRegexStd : public Module { public: StdRegexFactory ref; - ModuleRegexStd() : ref(this) { + ModuleRegexStd() : ref(this) + { ServerInstance->Modules->AddService(ref); Implementation eventlist[] = { I_OnRehash }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); @@ -84,12 +85,12 @@ public: { return Version("Regex Provider Module for std::regex", VF_VENDOR); } - + void OnRehash(User* u) { ConfigTag* Conf = ServerInstance->Config->ConfValue("stdregex"); std::string regextype = Conf->getString("type", "ecmascript"); - + if(regextype == "bre") ref.regextype = std::regex::basic; else if(regextype == "ere") |