forked from viva64/plog-converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigparser.h
41 lines (35 loc) · 1.19 KB
/
configparser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// 2006-2008 (c) Viva64.com Team
// 2008-2020 (c) OOO "Program Verification Systems"
#ifndef CONFIGPARSER_H
#define CONFIGPARSER_H
#include <vector>
#include <map>
#include <string>
#include <stdexcept>
#include <set>
namespace PlogConverter
{
class ConfigException : public std::runtime_error
{
public:
explicit ConfigException(const std::string& msg) : std::runtime_error(msg)
{}
};
class ConfigParser
{
const std::string m_pathToConfig;
std::multimap<std::string, std::string> m_configMap;
public:
ConfigParser(const std::string& pathToConfig, const std::vector<std::string>& multiArguments);
~ConfigParser();
void get(const std::string& optionName, std::string& destination);
void get(const std::string& optionName, std::vector<std::string>& destination, const std::string& delim = ",");
void get(const std::string& optionName, std::set<std::string>& destination, const std::string& delim = ",");
void getMulti(const std::string& optionName, std::vector<std::string>& destination);
void getMulti(const std::string& optionName, std::set<std::string>& destination);
private:
ConfigParser(const ConfigParser&);
ConfigParser& operator=(const ConfigParser&);
};
}
#endif // CONFIGPARSER_H