| 1024 | } |
| 1025 | |
| 1026 | std::unordered_map<string, const AnyMap*> AnyValue::asMap(const string& name) const |
| 1027 | { |
| 1028 | std::unordered_map<string, const AnyMap*> mapped; |
| 1029 | for (const auto& item : asVector<AnyMap>()) { |
| 1030 | auto key = item[name].asString(); |
| 1031 | if (mapped.count(key)) { |
| 1032 | throw InputFileError("AnyValue::asMap", *this, |
| 1033 | "Duplicate key '{}'", key); |
| 1034 | } |
| 1035 | mapped.emplace(std::make_pair(key, &item)); |
| 1036 | } |
| 1037 | return mapped; |
| 1038 | } |
| 1039 | |
| 1040 | std::unordered_map<string, AnyMap*> AnyValue::asMap(const string& name) |
| 1041 | { |
no test coverage detected