2020-05-08 12:43:46 +02:00
|
|
|
#ifndef CONFIG_READER_H
|
|
|
|
#define CONFIG_READER_H
|
|
|
|
#include <string>
|
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
class config_reader
|
|
|
|
{
|
|
|
|
public:
|
2020-06-01 23:23:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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 path);
|
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
2020-05-08 12:43:46 +02:00
|
|
|
bool get_param(std::string variable, std::string &value);
|
|
|
|
private:
|
|
|
|
std::ifstream file;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CONFIG_READER_H
|