diff --git a/src/SQLmanager.cpp b/src/SQLmanager.cpp index fbc3212..f61d1dc 100644 --- a/src/SQLmanager.cpp +++ b/src/SQLmanager.cpp @@ -1,3 +1,5 @@ +//database file location to read in the json? + //deployer SLmanager implementation // Copyright (C) 2024 Jean-Cloud // GNU General Public License v3 @@ -6,20 +8,50 @@ #include #include #include +#include #include "Service.h" +#include "SQLmanager.h" using namespace std; -//constructor and destructor inlin +//constructor +SQLmanager::SQLmanager() +{ + sqlite3 *db; + char *zErrMsg = 0; + int rc; -//services -vector GetServices() const; -const Service * FindServiceByUsername(string aUsername) const; -const Service * FindServiceByID(int aUserID) const; + rc = sqlite3_open("test.db", &db); + + if(rc) { + cerr << "Error. Database cannot be opened." << endl << sqlite3_errmsg(db) << endl; + } else { + cout << "Database opened" << endl; + } + sqlite3_close(db); +} + +//destructor inline + +//public methods +vector SQLmanager::GetServices() const +{ + +} +const Service * SQLmanager::FindServiceByUsername(string aUsername) const +{ + +} +const Service * SQLmanager::FindServiceByID(int aUserID) const +{ + +} //list FindServicesByServer(string aServer) const; -int isServiceOnServer(string serviceUsername); +int SQLmanager::isServiceOnServer(string serviceUsername) +{ + +} -vector services; diff --git a/src/SQLmanager.h b/src/SQLmanager.h index ecf8f9f..10602ff 100644 --- a/src/SQLmanager.h +++ b/src/SQLmanager.h @@ -15,7 +15,7 @@ using namespace std; class SQLmanager { public: - SQLmanager(){} + SQLmanager(); ~SQLmanager(){} //services vector GetServices() const;