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

32 lines
595 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 {
vector<string> necessary;
1 year ago
map<string, string> element;
bool isHaveNecessary();
bool init(const string _configFilePath);
1 year ago
public:
config(const string _configFilePath, const vector<string> _necessary = {});
string operator[] (const string& key);
1 year ago
void print();
};
#endif