| 70 | |
| 71 | template <typename ToDo> |
| 72 | bool ForEachOsmId2FeatureId(std::string const & path, ToDo && toDo) |
| 73 | { |
| 74 | generator::OsmID2FeatureID mapping; |
| 75 | try |
| 76 | { |
| 77 | FileReader reader(path); |
| 78 | NonOwningReaderSource source(reader); |
| 79 | mapping.ReadAndCheckHeader(source); |
| 80 | } |
| 81 | catch (FileReader::Exception const & e) |
| 82 | { |
| 83 | LOG(LERROR, ("Exception while reading file:", path, ", message:", e.Msg())); |
| 84 | return false; |
| 85 | } |
| 86 | |
| 87 | mapping.ForEach([&](auto const & p) { toDo(p.first /* osm id */, p.second /* feature id */); }); |
| 88 | return true; |
| 89 | } |
| 90 | |
| 91 | bool ParseFeatureIdToOsmIdMapping(std::string const & path, |
| 92 | ankerl::unordered_dense::map<uint32_t, base::GeoObjectId> & mapping); |
no test coverage detected