| 194 | |
| 195 | |
| 196 | const std::string File::GetValue(const std::string &key) |
| 197 | { |
| 198 | configure_mapping(); |
| 199 | |
| 200 | auto it = std::find_if(map.begin(), |
| 201 | map.end(), |
| 202 | [key](OptionMapEntry &e) |
| 203 | { |
| 204 | return key == e.option; |
| 205 | }); |
| 206 | if (it == map.end()) |
| 207 | { |
| 208 | throw OptionNotFound(key); |
| 209 | } |
| 210 | if (!it->present) |
| 211 | { |
| 212 | throw OptionNotPresent(key); |
| 213 | } |
| 214 | |
| 215 | if (OptionValueType::Present == it->type) |
| 216 | { |
| 217 | return (it->present_value ? "true" : "false"); |
| 218 | } |
| 219 | return it->value; |
| 220 | } |
| 221 | |
| 222 | |
| 223 | const int File::GetIntValue(const std::string &key) |
no test coverage detected