// // user.cc for marvin_gui in /home/castor/epita/marvin_gui // // Made by C@stor // Login // // Started on Wed Aug 27 19:38:57 2003 C@stor // Last update Tue Sep 9 23:59:10 2003 C@stor // #include #include "user.hh" #include "misc.hh" #include "language/language.hh" c_password::c_password(std::string passphrase, std::string neuronal) { _passphrase = passphrase; _neuronal_network_path = neuronal; } c_user::c_user(std::string name, std::string passphrase, std::string neuronal) { _name_user = name; _password = new c_password(passphrase, neuronal); } c_user::~c_user() { delete _password; } c_list_user::c_list_user() { std::cout << "##############################" << std::endl; std::cout << "##### The Marvin Project #####" << std::endl; std::cout << "##############################" << std::endl << std::endl; } int c_list_user::add_user(class c_user *user) { _list_user[_list_user.size()] = user; return 0; } int c_list_user::del_user(int id_user) { std::string answer; std::cout << DELUSERCONFIRM << " " << YESNO; answer = get_stdin(); std::cout << std::endl; if (answer == YES) { // FIXME : enlever user de la map _list_user.erase(id_user); std::cout << USERDEL << std::endl << std::endl; } return 0; // std::string answer; // std::cout << QUITCONFIRM << " " << YESNO; //answer = get_stdin(); //std::cout << std::endl; //std::cout << GOODBYE << std::endl << std::endl; //exit(1); } int c_list_user::print_list() { std::cout << PRINTLIST << std::endl; for (unsigned int i = 0; i < _list_user.size(); i++) { std::cout << i << " " << _list_user[i]->get_name_user() << std::endl; } return 0; }