| 299 | // Duplicate Checker |
| 300 | |
| 301 | inline void CheckDuplicates(const YAML::Node & node) |
| 302 | { |
| 303 | std::unordered_set<std::string> keyset; |
| 304 | |
| 305 | for (Iterator iter = node.begin(); iter != node.end(); ++iter) |
| 306 | { |
| 307 | const std::string & key = iter->first.as<std::string>(); |
| 308 | |
| 309 | if (keyset.find(key) == keyset.end()) |
| 310 | { |
| 311 | keyset.insert(key); |
| 312 | } |
| 313 | else |
| 314 | { |
| 315 | std::ostringstream os; |
| 316 | os << "Key-value pair with key '" << key; |
| 317 | os << "' specified more than once. "; |
| 318 | throwValueError(node.Tag(), iter->first, os.str()); |
| 319 | } |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | // Custom Key Loader |
| 324 |
no test coverage detected