Init commit

This commit is contained in:
2020-10-20 14:16:46 +02:00
commit 7a3fa50503
8 changed files with 524 additions and 0 deletions

17
include/config.hpp Normal file
View File

@ -0,0 +1,17 @@
#include <string>
#ifndef __CONFIG_HPP_
#define __CONFIG_HPP_
class Config {
private:
int8_t *numHilos;
std::string *tiempo;
public:
Config(int8_t nh, std::string t);
~Config();
int8_t getNumHilos();
std::string getTiempo();
void setNumHilos(int8_t nh);
void setTiempo(std::string t);
};
#endif // __CONFIG_HPP_

14
include/configFile.hpp Normal file
View File

@ -0,0 +1,14 @@
#include "config.hpp"
#include <fstream>
#include <string>
#ifndef __CONFIG_FILE_HPP_
#define __CONFIG_FILE_HPP_
namespace cf {
const std::string g_cofigFile = "~/.config/stressUI.cfg";
Config *openConfig();
void closeConfig(Config *config);
std::string getLine(std::ifstream *file);
void saveConfig();
void createConfig();
} // namespace cf
#endif // __CONFIG_FILE_HPP_

32
include/ui.hpp Normal file
View File

@ -0,0 +1,32 @@
#include <ncurses.h>
#include <string>
#include <vector>
#ifndef __UI_HPP_
#define __UI_HPP_
namespace ui {
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);
void closeUI();
// void userInterface(int8_t *menu);
// void userInterface(int8_t *menu, std::vector<std::string> *mensaje);
/*void userInterface(std::string *num_menu);
int8_t inputToInt(std::string *input);*/
// void showMenu(std::vector<std::string> *menu_elems, int8_t *num_menu);
// void showMenu(std::vector<std::string> *menu_elems, int8_t *num_menu,
// std::vector<std::string> *mensaje);
void showCentralInputBox(std::vector<std::string> *textos,
const int8_t *num_box,
std::vector<std::string> *elems);
void 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_