Library for parsing configuration files
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
config/lib/config.hpp

30 lines
697 B

1 year ago
#ifndef _CFG_
#define _CFG_
#include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include <string>
using namespace std;
void clearWhiteSpaces(string &a);
bool clearComments(string &a);
void parseConfigLine(const string a, string &b, string &c);
class config {
public:
vector<string> necessary; // = {"Username", "API", "Domain", "consolePrintLogs", "DinioServer1", "DinioServer2", "DinioGetIPURL", "DinioServer1Port", "DinioServer2Port" };
map<string, string> element;
config(const string _configFilePath, const vector<string> _necessary = {});
void print();
bool init(const string _configFilePath);
bool isHaveNecessary();
};
#endif