| 91 | } |
| 92 | |
| 93 | void KeyValueParserPrivate::parseStream(std::istream& stream) |
| 94 | { |
| 95 | std::map<std::string, std::string> m; |
| 96 | std::map<std::string, std::string>::iterator it; |
| 97 | std::string line; |
| 98 | |
| 99 | while ( getline (stream, line) ) { |
| 100 | if ((line.size() < 1) || (line[0] == '#')) { |
| 101 | continue; |
| 102 | } |
| 103 | |
| 104 | auto p = this->parseLine(line); |
| 105 | it = m.find(p.first); |
| 106 | |
| 107 | if (it != m.end()) { |
| 108 | m.emplace(p.first, p.second); |
| 109 | } |
| 110 | else { |
| 111 | m[p.first] = p.second; |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | this->_output_map = std::move(m); |
| 116 | } |
| 117 | |
| 118 | bool KeyValueParserPrivate::checkKeyValidity(const std::string& key) |
| 119 | { |
no test coverage detected