ServidorTFG
data_acces.h
1 #ifndef DATA_ACCES_H
2 #define DATA_ACCES_H
3 
4 #include <iostream>
5 #include <list>
6 
7 class data_acces
8 {
9 public:
14  data_acces();
21  virtual std::string get_passwd(std::string username) = 0;
27  virtual bool get_admin(std::string)=0;
33  virtual std::list<std::string> get_pinfo()=0;
39  virtual std::list<std::string> get_uinfo()=0;
46  virtual void write_install(std::string package, std::string user)=0;
52  virtual void write_remove(std::string package)=0;
59  virtual bool get_package_exists(std::string package)=0;
67  virtual void create_user(std::string user, std::string pass, bool admin)=0;
73  virtual void remove_user(std::string user)=0;
80  static char* get_hash(char *data);
81 };
82 #endif // DATA_ACCES_H
data_acces::get_admin
virtual bool get_admin(std::string)=0
get_admin Get if the user is a admin or not
data_acces::get_passwd
virtual std::string get_passwd(std::string username)=0
get_passwd Get the hash of the password that use the user
data_acces::get_hash
static char * get_hash(char *data)
get_hash Generate a hash with the pased data
Definition: data_acces.cpp:11
data_acces
Definition: data_acces.h:7
data_acces::write_remove
virtual void write_remove(std::string package)=0
write_remove Remove the information about generated package
data_acces::data_acces
data_acces()
data_acces Interface to program objects that manage the stored data
Definition: data_acces.cpp:6
data_acces::write_install
virtual void write_install(std::string package, std::string user)=0
write_install Store information about package generation
data_acces::get_uinfo
virtual std::list< std::string > get_uinfo()=0
get_uinfo Get a list of the users and if they are admins or not
data_acces::get_pinfo
virtual std::list< std::string > get_pinfo()=0
get_pinfo Get a list of the generated packages and the information about that
data_acces::get_package_exists
virtual bool get_package_exists(std::string package)=0
get_package_exists Search if the package exists
data_acces::remove_user
virtual void remove_user(std::string user)=0
remove_user Remove a user
data_acces::create_user
virtual void create_user(std::string user, std::string pass, bool admin)=0
create_user Create a new user with the passed data