suite sqlmanager
This commit is contained in:
parent
f6dbdc9fc3
commit
bc12dc6020
@ -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;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user