1 #ifndef _Belle2_ConfigFile_h
2 #define _Belle2_ConfigFile_h
17 typedef std::map<std::string, std::string> ValueList;
25 ConfigFile(
const std::string& file1,
const std::string& file2)
31 const std::string& file2,
32 const std::string& file3)
46 void read(
const std::string& filename,
bool overload =
true);
47 void read(std::istream& is,
bool overload =
true);
48 bool hasKey(
const std::string& label);
49 const std::string get(
const std::string& label);
50 int getInt(
const std::string& label);
51 bool getBool(
const std::string& label);
52 double getFloat(
const std::string& label);
53 ValueList& getValues() {
return m_value_m; }
54 std::vector<std::string>& getLabels() {
return m_label_v; }
55 void add(
const std::string& label,
56 const std::string& value,
bool overload);
57 void write(
const std::string& path);
61 const std::string getFilePath(
const std::string& filename);
65 std::vector<std::string> m_label_v;
67 std::map<std::string, int> m_count;
71 inline bool ConfigFile::hasKey(
const std::string& label)
73 return m_value_m.find((m_dir.size() > 0) ? m_dir +
"." + label : label)