suite sqlmanager

This commit is contained in:
eleonore12345 2024-09-14 00:32:37 +02:00
parent f6dbdc9fc3
commit bc12dc6020
2 changed files with 40 additions and 8 deletions

View File

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

View File

@ -15,7 +15,7 @@ using namespace std;
class SQLmanager { class SQLmanager {
public: public:
SQLmanager(){} SQLmanager();
~SQLmanager(){} ~SQLmanager(){}
//services //services
vector<Service> GetServices() const; vector<Service> GetServices() const;