ServidorTFG/msql_acces.h

34 lines
901 B
C
Raw Normal View History

2020-05-08 12:43:46 +02:00
#ifndef MSQL_ACCES_H
#define MSQL_ACCES_H
#include "data_acces.h"
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
#include <cppconn/prepared_statement.h>
class msql_acces : public data_acces
{
public:
2020-06-03 19:00:32 +02:00
static msql_acces* get_instance();
static std::string user;
static std::string pass;
2020-05-08 12:43:46 +02:00
std::string get_passwd(std::string username);
2020-05-26 18:48:31 +02:00
bool get_admin(std::string);
2020-05-13 00:58:32 +02:00
std::list<std::string> get_pinfo();
2020-05-20 00:10:05 +02:00
std::list<std::string> get_uinfo();
2020-05-15 21:39:23 +02:00
void write_install(std::string package, std::string user);
void write_remove(std::string);
2020-05-16 20:52:50 +02:00
bool get_package_exists(std::string package);
void create_user(std::string user, std::string pass, bool admin);
2020-05-26 01:37:34 +02:00
void remove_user(std::string user);
2020-05-08 12:43:46 +02:00
private:
2020-06-03 19:00:32 +02:00
msql_acces();
static msql_acces* instance;
2020-05-08 12:43:46 +02:00
sql::Connection *con;
sql::Driver *driver;
};
#endif // MSQL_ACCES_H