2020-05-08 12:42:02 +02:00
|
|
|
#ifndef CONFIG_READER_H
|
|
|
|
#define CONFIG_READER_H
|
|
|
|
#include <string>
|
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
class config_reader
|
|
|
|
{
|
|
|
|
public:
|
2020-06-01 23:24:24 +02:00
|
|
|
/**
|
|
|
|
* @brief config_reader
|
|
|
|
* Generate a objet to extract info to a config file
|
|
|
|
* @param path File path to extract the file
|
|
|
|
*/
|
2020-05-08 12:42:02 +02:00
|
|
|
config_reader(std::string);
|
2020-06-01 23:24:24 +02:00
|
|
|
/**
|
|
|
|
* @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:42:02 +02:00
|
|
|
bool get_param(std::string variable, std::string &value);
|
|
|
|
private:
|
|
|
|
std::ifstream file;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CONFIG_READER_H
|