refactoring, expand interface

This commit is contained in:
2020-05-13 00:56:26 +02:00
parent f9cdde7008
commit 7691c80fb4
12 changed files with 100 additions and 38 deletions

25
session_manager.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "session_manager.h"
#include "read_uses.h"
session_manager::session_manager(conexion* con)
{
this->con=con;
}
bool session_manager::loggin(std::string username, std::string passwd){
return this->con->check_pass(username, passwd);
}
int session_manager::install_command(std::string package){
read_uses uses(package);
this->con->write_string(package);
if(uses.exist_file()){
this->con->write_string("y");
this->con->write_string(*uses.get_uses());
}else{
this->con->write_string("n");
}
std::string buffer;
this->con->read_string(buffer,2);
return atoi(buffer.data());
}