add doxygen

This commit is contained in:
Guillermo Roche 2020-06-01 23:24:24 +02:00
parent f3a0bfed40
commit af365474a7
15 changed files with 241 additions and 10 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.8.2, 2020-05-27T13:14:37. --> <!-- Written by QtCreator 4.8.2, 2020-06-01T14:25:31. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>

View File

@ -5,10 +5,27 @@
class conexion class conexion
{ {
public: public:
/**
* @brief conexion
* Create a conexion
* @param conf Config file to give the parameters of conexion
*/
conexion(config_reader &conf); conexion(config_reader &conf);
/**
virtual ssize_t read_string(std::string &entrada, int size); * @brief read_string
virtual ssize_t write_string(std::string entrada); * Read a string in the socket
* @param input String readed
* @param size Length to read
* @return Size of bytes readed
*/
virtual ssize_t read_string(std::string &input, int size);
/**
* @brief write_string
* Write a sitring in the socket
* @param output String to send
* @return bytes sended
*/
virtual ssize_t write_string(std::string output);
protected: protected:
config_reader *config; config_reader *config;
int fd; int fd;

View File

@ -6,9 +6,27 @@
class conexion_ssl : public conexion class conexion_ssl : public conexion
{ {
public: public:
/**
* @brief conexion_ssl
* Create a secure conexion
* @param conf Config file to give the parameters of conexion
*/
conexion_ssl(config_reader &conf); conexion_ssl(config_reader &conf);
ssize_t read_string(std::string &entrada, int size); /**
ssize_t write_string(std::string entrada); * @brief read_string
* Read a string in the SSL socket
* @param input String readed
* @param size Length to read
* @return Size of bytes readed
*/
ssize_t read_string(std::string &input, int size);
/**
* @brief write_string
* Write a sitring in the secure socket
* @param output String to send
* @return bytes sended
*/
ssize_t write_string(std::string output);
private: private:
SSL* ssl; SSL* ssl;
}; };

View File

@ -6,7 +6,19 @@
class config_reader class config_reader
{ {
public: public:
/**
* @brief config_reader
* Generate a objet to extract info to a config file
* @param path File path to extract the file
*/
config_reader(std::string); config_reader(std::string);
/**
* @brief get_param
* Permit extract a value in a config file
* @param variable Name of a field to extract the info
* @param value Info extracted
* @return True if the field exists, false if not
*/
bool get_param(std::string variable, std::string &value); bool get_param(std::string variable, std::string &value);
private: private:
std::ifstream file; std::ifstream file;

View File

@ -16,6 +16,12 @@
class container_window: public Gtk::Window class container_window: public Gtk::Window
{ {
public: public:
/**
* @brief container_window
* Windos that contains all views and controlers
* @param con Conexion used in the aplication
* @param app App that contains the gtk loop
*/
container_window(conexion *con, Glib::RefPtr< Gtk::Application > app); container_window(conexion *con, Glib::RefPtr< Gtk::Application > app);
private: private:
Glib::RefPtr< Gtk::Application > app; Glib::RefPtr< Gtk::Application > app;

View File

@ -7,13 +7,37 @@
class controller_info class controller_info
{ {
public: public:
/**
* @brief controller_info
* View controler that expose package information
* @param view View to controle
* @param sesion Model to have the funcionality
*/
controller_info(view_info *view, session_manager *sesion); controller_info(view_info *view, session_manager *sesion);
private: private:
view_info *view; view_info *view;
session_manager *sesion; session_manager *sesion;
/**
* @brief load_info
* Load the info in the table
*/
void load_info(); void load_info();
/**
* @brief get_first
* Get the firs string until the special character ":"
* @param info String to divide, the string have substract the string returned, and the first ":"
* @return The string substracted
*/
std::string get_first(std::string &info); std::string get_first(std::string &info);
/**
* @brief on_button_clicked
* Button function
*/
void on_button_clicked(); void on_button_clicked();
/**
* @brief add_controlers
* Add controlers to the bottons
*/
void add_controlers(); void add_controlers();
}; };

View File

@ -6,11 +6,25 @@
class controller_install class controller_install
{ {
public: public:
controller_install(view_install*, session_manager*); /**
* @brief controller_install
* View controler that send a name package to build
* @param view View to controle
* @param sesion Model to have the funcionality
*/
controller_install(view_install* view, session_manager* sesion);
private: private:
view_install *vis; view_install *vis;
session_manager *sesi; session_manager *sesi;
/**
* @brief add_controlers
* Add controlers to the bottons
*/
void add_controlers(); void add_controlers();
/**
* @brief on_button_clicked
* Button function
*/
void on_button_clicked(); void on_button_clicked();
}; };

View File

@ -7,15 +7,44 @@
class controller_user_info class controller_user_info
{ {
public: public:
/**
* @brief controller_user_info
* Controller that expose users info
* @param view View to controle
* @param session Model that have funcionality
* @param container Container of the aplication
*/
controller_user_info(view_user_info *view, session_manager *session, Gtk::Window *container); controller_user_info(view_user_info *view, session_manager *session, Gtk::Window *container);
private: private:
view_user_info *view; view_user_info *view;
session_manager *sesion; session_manager *sesion;
Gtk::Window *container; Gtk::Window *container;
/**
* @brief load_info
* Load the info in the table
*/
void load_info(); void load_info();
/**
* @brief add_controlers
* Add controlers to the bottons
*/
void add_controlers(); void add_controlers();
/**
* @brief on_button_clicked_add
* Button add function
*/
void on_button_clicked_add(); void on_button_clicked_add();
/**
* @brief on_button_clicked_remove
* button remove function
*/
void on_button_clicked_remove(); void on_button_clicked_remove();
/**
* @brief get_first
* Get the firs string until the special character ":"
* @param info String to divide, the string have substract the string returned, and the first ":"
* @return The string substracted
*/
std::string get_first(std::string &info); std::string get_first(std::string &info);
}; };

View File

@ -12,6 +12,12 @@
class dialog_add_user : public Gtk::Dialog class dialog_add_user : public Gtk::Dialog
{ {
public: public:
/**
* @brief dialog_add_user
* Dialog to add users
* @param win Window to stop
* @param sesion Model to implement te funcionality
*/
dialog_add_user(Gtk::Window *win, session_manager *sesion); dialog_add_user(Gtk::Window *win, session_manager *sesion);
private: private:
session_manager *sesion; session_manager *sesion;
@ -29,8 +35,15 @@ private:
Gtk::CheckButton c_admin; Gtk::CheckButton c_admin;
Gtk::Button b_add; Gtk::Button b_add;
/**
* @brief on_button_clicked
* Button function
*/
void on_button_clicked(); void on_button_clicked();
/**
* @brief add_elements
* Add controlers to the bottons
*/
void add_elements(); void add_elements();
}; };

View File

@ -7,8 +7,23 @@
class read_uses class read_uses
{ {
public: public:
/**
* @brief read_uses
* Object that read configuration for a package
* @param name Name from a package
*/
read_uses(std::string name); read_uses(std::string name);
/**
* @brief get_uses
* Get the content of a config file
* @return Content of a config file
*/
std::string* get_uses(); std::string* get_uses();
/**
* @brief exist_file
* Say if a package have config file
* @return True if package exists, false if not
*/
bool exist_file(); bool exist_file();
private: private:
std::ifstream file; std::ifstream file;

View File

@ -9,16 +9,71 @@
class session_manager class session_manager
{ {
public: public:
/**
* @brief session_manager
* Object that manage the session, and gide on it
* @param con Conexion of the session
*/
session_manager(conexion* con); session_manager(conexion* con);
conexion* con; /**
* @brief loggin
* Loggin function
* @param username Username to try to start session
* @param passwd Password to the user
* @return True if the username have these password, false if not or the user not exists
*/
bool loggin(std::string username, std::string passwd); bool loggin(std::string username, std::string passwd);
/**
* @brief admin
* Get user privileges
* @return true if the admin can manage other users, false if not
*/
bool admin(); bool admin();
/**
* @brief install_command
* Send name of the package to build
* @param package Name of the package
* @return positive if it is build well, or negative if not
*/
int install_command(std::string package); int install_command(std::string package);
/**
* @brief remove_command
* Send name of the package to remove
* @param package Name of the package
* @return positive if it is removed well, or negative if not
*/
int remove_command(std::string package); int remove_command(std::string package);
/**
* @brief get_packages_info
* Get all packages information
* @return List of strings that contains all package information.
* Every package have the information separated with the sepacial character ":"
*/
std::list<std::string> get_packages_info(); std::list<std::string> get_packages_info();
/**
* @brief get_users_info
* Get all users username and privileges
* @return List of strings that contains all users information.
* Every users have the username first, and after separated with a ":"
* a t or a f, t if they have privileges or f if not
*/
std::list<std::string> get_users_info(); std::list<std::string> get_users_info();
/**
* @brief create_user
* Create a new user
* @param username Username for a new user
* @param password Password for a new user
* @param admin Privileges of a new user
*/
void create_user(std::string username, std::string password, bool admin); void create_user(std::string username, std::string password, bool admin);
/**
* @brief remove_user
* Remove a created user
* @param username Name of these
*/
void remove_user(std::string username); void remove_user(std::string username);
private:
conexion* con;
}; };
#endif // SESSION_MANAGER_H #endif // SESSION_MANAGER_H

View File

@ -9,6 +9,10 @@
class view_info: public Gtk::Box class view_info: public Gtk::Box
{ {
public: public:
/**
* @brief view_info
* View to show all package information
*/
view_info(); view_info();
Gtk::TreeView tree; Gtk::TreeView tree;
class ModelColumns : public Gtk::TreeModel::ColumnRecord class ModelColumns : public Gtk::TreeModel::ColumnRecord
@ -26,6 +30,10 @@ public:
Glib::RefPtr<Gtk::ListStore> m_refTreeModel; Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
Gtk::ButtonBox b_box; Gtk::ButtonBox b_box;
Gtk::Button b_remove; Gtk::Button b_remove;
/**
* @brief restart_table
* Rescan all packages information
*/
void restart_table(); void restart_table();
}; };

View File

@ -9,6 +9,10 @@
class view_install : public Gtk::Box class view_install : public Gtk::Box
{ {
public: public:
/**
* @brief view_install
* View to send name package to compile it
*/
view_install(); view_install();
Gtk::Button m_button; Gtk::Button m_button;
Gtk::Box m_VBox; Gtk::Box m_VBox;

View File

@ -11,6 +11,11 @@
class view_loggin : public Gtk::Window class view_loggin : public Gtk::Window
{ {
public: public:
/**
* @brief view_loggin
* View that permit show a loggig, include a minimal controler
* @param sesi Model that implements the funcionality
*/
view_loggin(session_manager *sesi); view_loggin(session_manager *sesi);
session_manager *sesi; session_manager *sesi;
@ -25,6 +30,10 @@ public:
Gtk::Button button; Gtk::Button button;
Gtk::Box box; Gtk::Box box;
/**
* @brief on_button_clicked
* Function of a button
*/
void on_button_clicked(); void on_button_clicked();
bool login; bool login;

View File

@ -9,6 +9,10 @@
class view_user_info: public Gtk::Box class view_user_info: public Gtk::Box
{ {
public: public:
/**
* @brief view_user_info
* View to show all users information
*/
view_user_info(); view_user_info();
Gtk::TreeView tree; Gtk::TreeView tree;
class ModelColumns : public Gtk::TreeModel::ColumnRecord class ModelColumns : public Gtk::TreeModel::ColumnRecord
@ -26,7 +30,10 @@ public:
Gtk::ButtonBox b_box; Gtk::ButtonBox b_box;
Gtk::Button b_add_user; Gtk::Button b_add_user;
Gtk::Button b_dell_user; Gtk::Button b_dell_user;
/**
* @brief restart_table
* Rescan all users information
*/
void restart_table(); void restart_table();
}; };