CosmoGRaPH v0.0
ConfigParser.h
1 #ifndef COSMO_CONFIGPARSER_H
2 #define COSMO_CONFIGPARSER_H
3 
4 #include <string>
5 #include <map>
6 
7 namespace cosmo
8 {
9 
11 {
12 public:
13  ConfigParser();
14  ConfigParser(std::string fname);
15  void parse(std::string fname);
16  std::string getFileName();
17 
18  std::string operator[](std::string param);
19  std::string operator()(std::string param, std::string default_val);
20 
21 private:
22  std::map<std::string, std::string> config;
23  std::string fileName;
24 };
25 
26 } /* namespace */
27 #endif
std::string operator[](std::string param)
Get value of required parameter.
Definition: ConfigParser.cc:55
Definition: bardeen.cc:5
Definition: ConfigParser.h:10
std::string operator()(std::string param, std::string default_val)
Get value of parameter; use default if not set.
Definition: ConfigParser.cc:74