Dar formato al código
This commit is contained in:
@ -2,15 +2,15 @@
|
||||
#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);
|
||||
int8_t getNumHilos();
|
||||
std::string getTiempo();
|
||||
void setNumHilos(int8_t numHilos);
|
||||
void setTiempo(std::string tiempo);
|
||||
public:
|
||||
Config(int8_t numHilos, std::string tiempo);
|
||||
int8_t getNumHilos();
|
||||
std::string getTiempo();
|
||||
void setNumHilos(int8_t numHilos);
|
||||
void setTiempo(std::string tiempo);
|
||||
};
|
||||
#endif // __CONFIG_HPP_
|
||||
|
@ -1,15 +1,16 @@
|
||||
#include "config.hpp"
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#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);
|
||||
void escribirText(std::ofstream *file, std::string *text, int numSpcs);
|
||||
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);
|
||||
void escribirText(std::ofstream *file, std::string *text, int numSpcs);
|
||||
} // namespace cf
|
||||
#endif // __CONFIG_FILE_HPP_
|
||||
|
@ -2,28 +2,30 @@
|
||||
#ifndef __EN_HPP_
|
||||
#define __EN_HPP_
|
||||
|
||||
namespace en{
|
||||
const extern std::string noColor = "The terminal doesn't support colors";
|
||||
const extern std::string errorGenerico_1 = "How do you get here?";
|
||||
const extern std::string errorGenerico_2 = "Just in case we drop you on the main menu";
|
||||
const extern std::string menuPrincipal = "Main Menu";
|
||||
const extern std::string menuPrincipal_1 = "- Start Stress Test";
|
||||
const extern std::string menuPrincipal_2 = "- Configurate";
|
||||
const extern std::string menuPrincipal_3 = "- Exit";
|
||||
const extern std::string menuConfigurar = "Configuration";
|
||||
const extern std::string menuConfigurar_1 = "- Configurate all";
|
||||
const extern std::string menuConfigurar_2 = "- Number of threads";
|
||||
const extern std::string menuConfigurar_3 = "- Time";
|
||||
const extern std::string menuConfigurar_4 = "- Main Menu";
|
||||
const extern std::string confTodo = "All the configuration will be write in ";
|
||||
const extern std::string confHilos = "Current number of threads > ";
|
||||
const extern std::string confTiempo = "Current execution time > ";
|
||||
const extern std::string confHilosInput = "- Number of threads\t> ";
|
||||
const extern std::string confTiempoInput = "- Execution time\t> ";
|
||||
const extern std::string confHilosError = "Must introduce a number";
|
||||
const extern std::string confTiempoError = "The time format must be HH:mm:ss";
|
||||
const extern std::string confArchText_1 = "Autogenerated file by Stress_UI";
|
||||
const extern std::string confArchText_2 = "Do not edit manually without knowing what you do";
|
||||
}
|
||||
namespace en {
|
||||
const extern std::string noColor = "The terminal doesn't support colors";
|
||||
const extern std::string errorGenerico_1 = "How do you get here?";
|
||||
const extern std::string errorGenerico_2 =
|
||||
"Just in case we drop you on the main menu";
|
||||
const extern std::string menuPrincipal = "Main Menu";
|
||||
const extern std::string menuPrincipal_1 = "- Start Stress Test";
|
||||
const extern std::string menuPrincipal_2 = "- Configurate";
|
||||
const extern std::string menuPrincipal_3 = "- Exit";
|
||||
const extern std::string menuConfigurar = "Configuration";
|
||||
const extern std::string menuConfigurar_1 = "- Configurate all";
|
||||
const extern std::string menuConfigurar_2 = "- Number of threads";
|
||||
const extern std::string menuConfigurar_3 = "- Time";
|
||||
const extern std::string menuConfigurar_4 = "- Main Menu";
|
||||
const extern std::string confTodo = "All the configuration will be write in ";
|
||||
const extern std::string confHilos = "Current number of threads > ";
|
||||
const extern std::string confTiempo = "Current execution time > ";
|
||||
const extern std::string confHilosInput = "- Number of threads\t> ";
|
||||
const extern std::string confTiempoInput = "- Execution time\t> ";
|
||||
const extern std::string confHilosError = "Must introduce a number";
|
||||
const extern std::string confTiempoError = "The time format must be HH:mm:ss";
|
||||
const extern std::string confArchText_1 = "Autogenerated file by Stress_UI";
|
||||
const extern std::string confArchText_2 =
|
||||
"Do not edit manually without knowing what you do";
|
||||
} // namespace en
|
||||
|
||||
#endif // __EN_HPP_
|
||||
|
@ -2,28 +2,31 @@
|
||||
#ifndef __ES_HPP_
|
||||
#define __ES_HPP_
|
||||
|
||||
namespace es{
|
||||
const extern std::string noColor = "El terminal no soporta colores";
|
||||
const extern std::string errorGenerico_1 = "¿Como has llegado aquí?";
|
||||
const extern std::string errorGenerico_2 = "Por si acaso vamos al menú principal";
|
||||
const extern std::string menuPrincipal = "Menú Principal";
|
||||
const extern std::string menuPrincipal_1 = "- Iniciar Stress Test";
|
||||
const extern std::string menuPrincipal_2 = "- Configurar";
|
||||
const extern std::string menuPrincipal_3 = "- Salir";
|
||||
const extern std::string menuConfigurar = "Configuración";
|
||||
const extern std::string menuConfigurar_1 = "- Configurar todo";
|
||||
const extern std::string menuConfigurar_2 = "- Número de hilos";
|
||||
const extern std::string menuConfigurar_3 = "- Tiempo";
|
||||
const extern std::string menuConfigurar_4 = "- Menú principal";
|
||||
const extern std::string confTodo = "Toda la configuración se escribirá en ";
|
||||
const extern std::string confHilos = "Número de hilos actuales > ";
|
||||
const extern std::string confTiempo = "Tiempo actual > ";
|
||||
const extern std::string confHilosInput = "- Número de hilos\t> ";
|
||||
const extern std::string confTiempoInput = "- Tiempo de ejecución\t> ";
|
||||
const extern std::string confHilosError = "Se debe introducir un número";
|
||||
const extern std::string confTiempoError = "El formato del tiempo debe ser HH:mm:ss";
|
||||
const extern std::string confArchText_1 = "Archivo autogenerado por Stress_UI";
|
||||
const extern std::string confArchText_2 = "No editar manualmente sin saber lo que se hace";
|
||||
}
|
||||
namespace es {
|
||||
const extern std::string noColor = "El terminal no soporta colores";
|
||||
const extern std::string errorGenerico_1 = "¿Como has llegado aquí?";
|
||||
const extern std::string errorGenerico_2 =
|
||||
"Por si acaso vamos al menú principal";
|
||||
const extern std::string menuPrincipal = "Menú Principal";
|
||||
const extern std::string menuPrincipal_1 = "- Iniciar Stress Test";
|
||||
const extern std::string menuPrincipal_2 = "- Configurar";
|
||||
const extern std::string menuPrincipal_3 = "- Salir";
|
||||
const extern std::string menuConfigurar = "Configuración";
|
||||
const extern std::string menuConfigurar_1 = "- Configurar todo";
|
||||
const extern std::string menuConfigurar_2 = "- Número de hilos";
|
||||
const extern std::string menuConfigurar_3 = "- Tiempo";
|
||||
const extern std::string menuConfigurar_4 = "- Menú principal";
|
||||
const extern std::string confTodo = "Toda la configuración se escribirá en ";
|
||||
const extern std::string confHilos = "Número de hilos actuales > ";
|
||||
const extern std::string confTiempo = "Tiempo actual > ";
|
||||
const extern std::string confHilosInput = "- Número de hilos\t> ";
|
||||
const extern std::string confTiempoInput = "- Tiempo de ejecución\t> ";
|
||||
const extern std::string confHilosError = "Se debe introducir un número";
|
||||
const extern std::string confTiempoError =
|
||||
"El formato del tiempo debe ser HH:mm:ss";
|
||||
const extern std::string confArchText_1 = "Archivo autogenerado por Stress_UI";
|
||||
const extern std::string confArchText_2 =
|
||||
"No editar manualmente sin saber lo que se hace";
|
||||
} // namespace es
|
||||
|
||||
#endif // __ES_HPP_
|
||||
|
@ -2,28 +2,30 @@
|
||||
#ifndef __GL_HPP_
|
||||
#define __GL_HPP_
|
||||
|
||||
namespace gl{
|
||||
const extern std::string noColor = "O terminal non soporta cores";
|
||||
const extern std::string errorGenerico_1 = "Como chegaches aquí?";
|
||||
const extern std::string errorGenerico_2 = "Por si acaso imos ó menú principal";
|
||||
const extern std::string menuPrincipal = "Menú Principal";
|
||||
const extern std::string menuPrincipal_1 = "- Iniciar Stress Test";
|
||||
const extern std::string menuPrincipal_2 = "- Configurar";
|
||||
const extern std::string menuPrincipal_3 = "- Saír";
|
||||
const extern std::string menuConfigurar = "Configuración";
|
||||
const extern std::string menuConfigurar_1 = "- Configurar todo";
|
||||
const extern std::string menuConfigurar_2 = "- Número de fíos";
|
||||
const extern std::string menuConfigurar_3 = "- Tempo";
|
||||
const extern std::string menuConfigurar_4 = "- Menú principal";
|
||||
const extern std::string confTodo = "Toda a configuración escribirase en ";
|
||||
const extern std::string confHilos = "Número de fíos actuáis > ";
|
||||
const extern std::string confTiempo = "Tempo de execución actual > ";
|
||||
const extern std::string confHilosInput = "- Número de fíos\t> ";
|
||||
const extern std::string confTiempoInput = "- Tempo de execución\t> ";
|
||||
const extern std::string confHilosError = "Debese introducir un número";
|
||||
const extern std::string confTiempoError = "O formato do tempo debe ser HH:mm:ss";
|
||||
const extern std::string confArchText_1 = "Arquivo autoxenerado por Stress_UI";
|
||||
const extern std::string confArchText_2 = "Non editar manualmente sin saber o que se fai";
|
||||
}
|
||||
namespace gl {
|
||||
const extern std::string noColor = "O terminal non soporta cores";
|
||||
const extern std::string errorGenerico_1 = "Como chegaches aquí?";
|
||||
const extern std::string errorGenerico_2 = "Por si acaso imos ó menú principal";
|
||||
const extern std::string menuPrincipal = "Menú Principal";
|
||||
const extern std::string menuPrincipal_1 = "- Iniciar Stress Test";
|
||||
const extern std::string menuPrincipal_2 = "- Configurar";
|
||||
const extern std::string menuPrincipal_3 = "- Saír";
|
||||
const extern std::string menuConfigurar = "Configuración";
|
||||
const extern std::string menuConfigurar_1 = "- Configurar todo";
|
||||
const extern std::string menuConfigurar_2 = "- Número de fíos";
|
||||
const extern std::string menuConfigurar_3 = "- Tempo";
|
||||
const extern std::string menuConfigurar_4 = "- Menú principal";
|
||||
const extern std::string confTodo = "Toda a configuración escribirase en ";
|
||||
const extern std::string confHilos = "Número de fíos actuáis > ";
|
||||
const extern std::string confTiempo = "Tempo de execución actual > ";
|
||||
const extern std::string confHilosInput = "- Número de fíos\t> ";
|
||||
const extern std::string confTiempoInput = "- Tempo de execución\t> ";
|
||||
const extern std::string confHilosError = "Debese introducir un número";
|
||||
const extern std::string confTiempoError =
|
||||
"O formato do tempo debe ser HH:mm:ss";
|
||||
const extern std::string confArchText_1 = "Arquivo autoxenerado por Stress_UI";
|
||||
const extern std::string confArchText_2 =
|
||||
"Non editar manualmente sin saber o que se fai";
|
||||
} // namespace gl
|
||||
|
||||
#endif // __GL_HPP_
|
||||
|
@ -2,30 +2,30 @@
|
||||
#ifndef __TEXTOS_HPP_
|
||||
#define __TEXTOS_HPP_
|
||||
|
||||
namespace txt{
|
||||
extern std::string g_noColor;
|
||||
extern std::string g_errorGenerico_1;
|
||||
extern std::string g_errorGenerico_2;
|
||||
extern std::string g_menuPrincipal;
|
||||
extern std::string g_menuPrincipal_1;
|
||||
extern std::string g_menuPrincipal_2;
|
||||
extern std::string g_menuPrincipal_3;
|
||||
extern std::string g_menuConfigurar;
|
||||
extern std::string g_menuConfigurar_1;
|
||||
extern std::string g_menuConfigurar_2;
|
||||
extern std::string g_menuConfigurar_3;
|
||||
extern std::string g_menuConfigurar_4;
|
||||
extern std::string g_confTodo;
|
||||
extern std::string g_confHilos;
|
||||
extern std::string g_confTiempo;
|
||||
extern std::string g_confHilosInput;
|
||||
extern std::string g_confTiempoInput;
|
||||
extern std::string g_confHilosError;
|
||||
extern std::string g_confTiempoError;
|
||||
extern std::string g_confArchText_1;
|
||||
extern std::string g_confArchText_2;
|
||||
namespace txt {
|
||||
extern std::string g_noColor;
|
||||
extern std::string g_errorGenerico_1;
|
||||
extern std::string g_errorGenerico_2;
|
||||
extern std::string g_menuPrincipal;
|
||||
extern std::string g_menuPrincipal_1;
|
||||
extern std::string g_menuPrincipal_2;
|
||||
extern std::string g_menuPrincipal_3;
|
||||
extern std::string g_menuConfigurar;
|
||||
extern std::string g_menuConfigurar_1;
|
||||
extern std::string g_menuConfigurar_2;
|
||||
extern std::string g_menuConfigurar_3;
|
||||
extern std::string g_menuConfigurar_4;
|
||||
extern std::string g_confTodo;
|
||||
extern std::string g_confHilos;
|
||||
extern std::string g_confTiempo;
|
||||
extern std::string g_confHilosInput;
|
||||
extern std::string g_confTiempoInput;
|
||||
extern std::string g_confHilosError;
|
||||
extern std::string g_confTiempoError;
|
||||
extern std::string g_confArchText_1;
|
||||
extern std::string g_confArchText_2;
|
||||
|
||||
void inicializarIdioma(std::string idioma);
|
||||
}
|
||||
void inicializarIdioma(std::string idioma);
|
||||
} // namespace txt
|
||||
|
||||
#endif // __TEXTOS_HPP_
|
||||
|
@ -5,16 +5,27 @@
|
||||
#define __UI_HPP_
|
||||
|
||||
namespace ui {
|
||||
extern int g_maxLines, g_maxCols, g_begCol, g_begLine, g_menuWith;
|
||||
//int8_t error;
|
||||
extern bool g_mensaje;
|
||||
extern int g_maxLines, g_maxCols, g_begCol, g_begLine, g_menuWith;
|
||||
// int8_t error;
|
||||
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();
|
||||
std::vector<std::string> showCentralInputBox(std::vector<std::string> *textos, const int8_t *num_box, std::vector<std::string> *elems, const int8_t *color_error);
|
||||
std::vector<std::string> showCentralInputBox(std::vector<std::string> *textos, const int8_t *num_box, std::vector<std::string> *elems, long title_size, const int8_t *color_error);
|
||||
void showCenterMensaje(std::vector<std::string> *mensaje, const int8_t *menu_color);
|
||||
void showTopTitle(const std::vector<std::string> *titulo);
|
||||
void closeUI();
|
||||
std::vector<std::string> showCentralInputBox(std::vector<std::string> *textos,
|
||||
const int8_t *num_box,
|
||||
std::vector<std::string> *elems,
|
||||
const int8_t *color_error);
|
||||
|
||||
std::vector<std::string> showCentralInputBox(std::vector<std::string> *textos,
|
||||
const int8_t *num_box,
|
||||
std::vector<std::string> *elems,
|
||||
long title_size,
|
||||
const int8_t *color_error);
|
||||
|
||||
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_
|
||||
|
Reference in New Issue
Block a user