add doxygen
This commit is contained in:
parent
f3a0bfed40
commit
af365474a7
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
23
conexion.h
23
conexion.h
@ -5,10 +5,27 @@
|
||||
class conexion
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief conexion
|
||||
* Create a conexion
|
||||
* @param conf Config file to give the parameters of conexion
|
||||
*/
|
||||
conexion(config_reader &conf);
|
||||
|
||||
virtual ssize_t read_string(std::string &entrada, int size);
|
||||
virtual ssize_t write_string(std::string entrada);
|
||||
/**
|
||||
* @brief read_string
|
||||
* 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:
|
||||
config_reader *config;
|
||||
int fd;
|
||||
|
@ -6,9 +6,27 @@
|
||||
class conexion_ssl : public conexion
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief conexion_ssl
|
||||
* Create a secure conexion
|
||||
* @param conf Config file to give the parameters of conexion
|
||||
*/
|
||||
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:
|
||||
SSL* ssl;
|
||||
};
|
||||
|
@ -6,7 +6,19 @@
|
||||
class config_reader
|
||||
{
|
||||
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);
|
||||
/**
|
||||
* @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);
|
||||
private:
|
||||
std::ifstream file;
|
||||
|
@ -16,6 +16,12 @@
|
||||
class container_window: public Gtk::Window
|
||||
{
|
||||
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);
|
||||
private:
|
||||
Glib::RefPtr< Gtk::Application > app;
|
||||
|
@ -7,13 +7,37 @@
|
||||
class controller_info
|
||||
{
|
||||
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);
|
||||
private:
|
||||
view_info *view;
|
||||
session_manager *sesion;
|
||||
/**
|
||||
* @brief load_info
|
||||
* Load the info in the table
|
||||
*/
|
||||
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);
|
||||
/**
|
||||
* @brief on_button_clicked
|
||||
* Button function
|
||||
*/
|
||||
void on_button_clicked();
|
||||
/**
|
||||
* @brief add_controlers
|
||||
* Add controlers to the bottons
|
||||
*/
|
||||
void add_controlers();
|
||||
};
|
||||
|
||||
|
@ -6,11 +6,25 @@
|
||||
class controller_install
|
||||
{
|
||||
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:
|
||||
view_install *vis;
|
||||
session_manager *sesi;
|
||||
/**
|
||||
* @brief add_controlers
|
||||
* Add controlers to the bottons
|
||||
*/
|
||||
void add_controlers();
|
||||
/**
|
||||
* @brief on_button_clicked
|
||||
* Button function
|
||||
*/
|
||||
void on_button_clicked();
|
||||
};
|
||||
|
||||
|
@ -7,15 +7,44 @@
|
||||
class controller_user_info
|
||||
{
|
||||
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);
|
||||
private:
|
||||
view_user_info *view;
|
||||
session_manager *sesion;
|
||||
Gtk::Window *container;
|
||||
/**
|
||||
* @brief load_info
|
||||
* Load the info in the table
|
||||
*/
|
||||
void load_info();
|
||||
/**
|
||||
* @brief add_controlers
|
||||
* Add controlers to the bottons
|
||||
*/
|
||||
void add_controlers();
|
||||
/**
|
||||
* @brief on_button_clicked_add
|
||||
* Button add function
|
||||
*/
|
||||
void on_button_clicked_add();
|
||||
/**
|
||||
* @brief on_button_clicked_remove
|
||||
* button remove function
|
||||
*/
|
||||
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);
|
||||
};
|
||||
|
||||
|
@ -12,6 +12,12 @@
|
||||
class dialog_add_user : public Gtk::Dialog
|
||||
{
|
||||
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);
|
||||
private:
|
||||
session_manager *sesion;
|
||||
@ -29,8 +35,15 @@ private:
|
||||
Gtk::CheckButton c_admin;
|
||||
|
||||
Gtk::Button b_add;
|
||||
|
||||
/**
|
||||
* @brief on_button_clicked
|
||||
* Button function
|
||||
*/
|
||||
void on_button_clicked();
|
||||
/**
|
||||
* @brief add_elements
|
||||
* Add controlers to the bottons
|
||||
*/
|
||||
void add_elements();
|
||||
};
|
||||
|
||||
|
15
read_uses.h
15
read_uses.h
@ -7,8 +7,23 @@
|
||||
class read_uses
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief read_uses
|
||||
* Object that read configuration for a package
|
||||
* @param name Name from a package
|
||||
*/
|
||||
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();
|
||||
/**
|
||||
* @brief exist_file
|
||||
* Say if a package have config file
|
||||
* @return True if package exists, false if not
|
||||
*/
|
||||
bool exist_file();
|
||||
private:
|
||||
std::ifstream file;
|
||||
|
@ -9,16 +9,71 @@
|
||||
class session_manager
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief session_manager
|
||||
* Object that manage the session, and gide on it
|
||||
* @param con Conexion of the session
|
||||
*/
|
||||
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);
|
||||
/**
|
||||
* @brief admin
|
||||
* Get user privileges
|
||||
* @return true if the admin can manage other users, false if not
|
||||
*/
|
||||
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);
|
||||
/**
|
||||
* @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);
|
||||
/**
|
||||
* @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();
|
||||
/**
|
||||
* @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();
|
||||
/**
|
||||
* @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);
|
||||
/**
|
||||
* @brief remove_user
|
||||
* Remove a created user
|
||||
* @param username Name of these
|
||||
*/
|
||||
void remove_user(std::string username);
|
||||
private:
|
||||
conexion* con;
|
||||
};
|
||||
|
||||
#endif // SESSION_MANAGER_H
|
||||
|
@ -9,6 +9,10 @@
|
||||
class view_info: public Gtk::Box
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief view_info
|
||||
* View to show all package information
|
||||
*/
|
||||
view_info();
|
||||
Gtk::TreeView tree;
|
||||
class ModelColumns : public Gtk::TreeModel::ColumnRecord
|
||||
@ -26,6 +30,10 @@ public:
|
||||
Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
|
||||
Gtk::ButtonBox b_box;
|
||||
Gtk::Button b_remove;
|
||||
/**
|
||||
* @brief restart_table
|
||||
* Rescan all packages information
|
||||
*/
|
||||
void restart_table();
|
||||
};
|
||||
|
||||
|
@ -9,6 +9,10 @@
|
||||
class view_install : public Gtk::Box
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief view_install
|
||||
* View to send name package to compile it
|
||||
*/
|
||||
view_install();
|
||||
Gtk::Button m_button;
|
||||
Gtk::Box m_VBox;
|
||||
|
@ -11,6 +11,11 @@
|
||||
class view_loggin : public Gtk::Window
|
||||
{
|
||||
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);
|
||||
session_manager *sesi;
|
||||
|
||||
@ -25,6 +30,10 @@ public:
|
||||
Gtk::Button button;
|
||||
Gtk::Box box;
|
||||
|
||||
/**
|
||||
* @brief on_button_clicked
|
||||
* Function of a button
|
||||
*/
|
||||
void on_button_clicked();
|
||||
|
||||
bool login;
|
||||
|
@ -9,6 +9,10 @@
|
||||
class view_user_info: public Gtk::Box
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief view_user_info
|
||||
* View to show all users information
|
||||
*/
|
||||
view_user_info();
|
||||
Gtk::TreeView tree;
|
||||
class ModelColumns : public Gtk::TreeModel::ColumnRecord
|
||||
@ -26,7 +30,10 @@ public:
|
||||
Gtk::ButtonBox b_box;
|
||||
Gtk::Button b_add_user;
|
||||
Gtk::Button b_dell_user;
|
||||
|
||||
/**
|
||||
* @brief restart_table
|
||||
* Rescan all users information
|
||||
*/
|
||||
void restart_table();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user