]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_regex_stdlib.cpp
m_spanningtree Remove unneeded #includes
[user/henk/code/inspircd.git] / src / modules / extra / m_regex_stdlib.cpp
index 204728b652601290c3b64e25e913dd8da721aea6..3c15f5568886e0d05688fe23938c773427331ccc 100644 (file)
@@ -15,9 +15,9 @@
  * 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 "modules/regex.h"
 #include <regex>
 
 /* $ModDesc: Regex Provider Module for std::regex Regular Expressions */
  *  Specify the Regular Expression engine to use here. Valid settings are
  *  bre, ere, awk, grep, egrep, ecmascript (default if not specified)*/
 /* $CompileFlags: -std=c++11 */
-/* $ModDep: m_regex.h */
+/* $ModDep: modules/regex.h */
 
 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")