#include <ConfigFile.h>
Definition at line 64 of file ConfigFile.h.
◆ const_iterator
◆ iterator
◆ ConfigFile()
kbenchmark::ConfigFile::ConfigFile |
( |
const std::string & |
config | ) |
|
|
inline |
Definition at line 71 of file ConfigFile.h.
71 : _name{getName(config)}
72 {
74
75 std::string line;
76 int id;
77 std::string key;
78 std::string value;
79 size_t pos;
80
81 while (std::getline(file, line))
82 {
83 if (!line.length())
84 continue;
85 if (line[0] == '#')
86 continue;
87 if (line[0] == '[')
88 {
89 id = std::stoi(line.substr(1, line.find(']') - 1));
90 continue;
91 }
92 pos = line.find(':');
93 key = line.substr(0, pos);
94 value = trim(line.substr(pos + 1), " []");
95 _contents[id][key] = value;
96 }
97 }
◆ begin() [1/2]
iterator kbenchmark::ConfigFile::begin |
( |
void |
| ) |
|
|
inline |
Definition at line 101 of file ConfigFile.h.
101{ return _contents.begin(); }
◆ begin() [2/2]
Definition at line 103 of file ConfigFile.h.
103{ return _contents.begin(); }
◆ cbegin()
Definition at line 105 of file ConfigFile.h.
105{ return _contents.cbegin(); }
◆ cend()
Definition at line 106 of file ConfigFile.h.
106{ return _contents.cend(); }
◆ end() [1/2]
iterator kbenchmark::ConfigFile::end |
( |
void |
| ) |
|
|
inline |
Definition at line 102 of file ConfigFile.h.
102{ return _contents.end(); }
◆ end() [2/2]
Definition at line 104 of file ConfigFile.h.
104{ return _contents.end(); }
◆ name()
const std::string kbenchmark::ConfigFile::name |
( |
void |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: