Re-factorización del código

Signed-off-by: somebody_master <somebody_master@somebodyserver.mooo.com>
This commit is contained in:
2020-10-27 16:39:38 +01:00
parent b0aa7eea06
commit e2b7ac2434
7 changed files with 154 additions and 223 deletions

View File

@ -2,16 +2,16 @@
#ifndef __CONFIG_HPP_
#define __CONFIG_HPP_
class Config {
private:
int8_t *numHilos;
std::string *tiempo;
private:
int8_t *numHilos;
std::string *tiempo;
public:
Config(int8_t numHilos, std::string tiempo);
// ~Config();
int8_t getNumHilos();
std::string getTiempo();
void setNumHilos(int8_t numHilos);
void setTiempo(std::string timepo);
public:
Config(int8_t numHilos, std::string tiempo);
// ~Config();
int8_t getNumHilos();
std::string getTiempo();
void setNumHilos(int8_t numHilos);
void setTiempo(std::string timepo);
};
#endif // __CONFIG_HPP_

View File

@ -4,11 +4,10 @@
#ifndef __CONFIG_FILE_HPP_
#define __CONFIG_FILE_HPP_
namespace cf {
const std::string g_configFile =
std::string(getenv("HOME")) + "/.config/stressUI.cfg";
Config openConfig();
void closeConfig(Config *config);
std::string getLine(std::ifstream *file);
void saveConfig(Config *config);
const std::string g_configFile = std::string(getenv("HOME")) + "/.config/stressUI.cfg";
Config openConfig();
void closeConfig(Config *config);
std::string getLine(std::ifstream *file);
void saveConfig(Config *config);
} // namespace cf
#endif // __CONFIG_FILE_HPP_

View File

@ -5,21 +5,15 @@
#define __UI_HPP_
namespace ui {
extern int g_maxLines, g_maxCols, g_begCol, g_begLine, g_menuWith;
extern bool g_mensaje;
extern int g_maxLines, g_maxCols, g_begCol, g_begLine, g_menuWith;
extern bool g_mensaje;
int8_t initUI(const int8_t *menu_principal, const int8_t *menu_error);
int8_t initUI(const int8_t *menu_principal, const int8_t *menu_error);
void closeUI();
void showCentralInputBox(std::vector<std::string> *textos,
const int8_t *num_box,
std::vector<std::string> *elems);
std::vector<std::string> showCentralInputBox(std::vector<std::string> *textos,
const int8_t *num_box,
std::vector<std::string> *elems,
long title_size);
void showCenterMensaje(std::vector<std::string> *mensaje,
const int8_t *menu_color);
void showTopTitle(const std::vector<std::string> *titulo);
void closeUI();
void showCentralInputBox(std::vector<std::string> *textos, const int8_t *num_box, std::vector<std::string> *elems);
std::vector<std::string> showCentralInputBox(std::vector<std::string> *textos, const int8_t *num_box, std::vector<std::string> *elems, long title_size);
void showCenterMensaje(std::vector<std::string> *mensaje, const int8_t *menu_color);
void showTopTitle(const std::vector<std::string> *titulo);
} // namespace ui
#endif // __UI_HPP_