]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_sqlite3.cpp
Clean up the build system properties and related code.
[user/henk/code/inspircd.git] / src / modules / extra / m_sqlite3.cpp
index 171c11f038ec76d20ea7a6684287664f96e83f33..54a2788ebc1a780c43e9ac95e6980cc488b9a275 100644 (file)
 
 #include "inspircd.h"
 #include <sqlite3.h>
-#include "sql.h"
+#include "modules/sql.h"
 
 #ifdef _WIN32
 # pragma comment(lib, "sqlite3.lib")
 #endif
 
-/* $ModDesc: sqlite3 provider */
-/* $CompileFlags: pkgconfversion("sqlite3","3.3") pkgconfincludes("sqlite3","/sqlite3.h","") */
+/* $CompileFlags: pkgconfversion("sqlite3","3.3") pkgconfincludes("sqlite3","/sqlite3.h","") -Wno-pedantic */
 /* $LinkerFlags: pkgconflibs("sqlite3","/libsqlite3.so","-lsqlite3") */
-/* $NoPedantic */
 
 class SQLConn;
 typedef std::map<std::string, SQLConn*> ConnMap;
@@ -48,12 +46,12 @@ class SQLite3Result : public SQLResult
        {
        }
 
-       virtual int Rows()
+       int Rows()
        {
                return rows;
        }
 
-       virtual bool GetRow(SQLEntries& result)
+       bool GetRow(SQLEntries& result)
        {
                if (currentrow < rows)
                {
@@ -68,7 +66,7 @@ class SQLite3Result : public SQLResult
                }
        }
 
-       virtual void GetCols(std::vector<std::string>& result)
+       void GetCols(std::vector<std::string>& result)
        {
                result.assign(columns.begin(), columns.end());
        }
@@ -85,7 +83,7 @@ class SQLConn : public SQLProvider
                std::string host = tag->getString("hostname");
                if (sqlite3_open_v2(host.c_str(), &conn, SQLITE_OPEN_READWRITE, 0) != SQLITE_OK)
                {
-                       ServerInstance->Logs->Log("m_sqlite3",DEFAULT, "WARNING: Could not open DB with id: " + tag->getString("id"));
+                       ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "WARNING: Could not open DB with id: " + tag->getString("id"));
                        conn = NULL;
                }
        }
@@ -144,13 +142,13 @@ class SQLConn : public SQLProvider
                sqlite3_finalize(stmt);
        }
 
-       virtual void submit(SQLQuery* query, const std::string& q)
+       void submit(SQLQuery* query, const std::string& q)
        {
                Query(query, q);
                delete query;
        }
 
-       virtual void submit(SQLQuery* query, const std::string& q, const ParamL& p)
+       void submit(SQLQuery* query, const std::string& q, const ParamL& p)
        {
                std::string res;
                unsigned int param = 0;
@@ -171,7 +169,7 @@ class SQLConn : public SQLProvider
                submit(query, res);
        }
 
-       virtual void submit(SQLQuery* query, const std::string& q, const ParamM& p)
+       void submit(SQLQuery* query, const std::string& q, const ParamM& p)
        {
                std::string res;
                for(std::string::size_type i = 0; i < q.length(); i++)
@@ -204,15 +202,12 @@ class ModuleSQLite3 : public Module
        ConnMap conns;
 
  public:
-       void init()
+       void init() CXX11_OVERRIDE
        {
                ReadConf();
-
-               Implementation eventlist[] = { I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
-       virtual ~ModuleSQLite3()
+       ~ModuleSQLite3()
        {
                ClearConns();
        }
@@ -242,12 +237,12 @@ class ModuleSQLite3 : public Module
                }
        }
 
-       void OnRehash(User* user)
+       void OnRehash(User* user) CXX11_OVERRIDE
        {
                ReadConf();
        }
 
-       Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("sqlite3 provider", VF_VENDOR);
        }