| 20 | namespace traffic |
| 21 | { |
| 22 | bool GenerateTrafficKeysFromDataFile(std::string const & mwmPath) |
| 23 | { |
| 24 | try |
| 25 | { |
| 26 | std::vector<TrafficInfo::RoadSegmentId> keys; |
| 27 | TrafficInfo::ExtractTrafficKeys(mwmPath, keys); |
| 28 | |
| 29 | std::vector<uint8_t> buf; |
| 30 | TrafficInfo::SerializeTrafficKeys(keys, buf); |
| 31 | |
| 32 | FilesContainerW writeContainer(mwmPath, FileWriter::OP_WRITE_EXISTING); |
| 33 | auto writer = writeContainer.GetWriter(TRAFFIC_KEYS_FILE_TAG); |
| 34 | writer->Write(buf.data(), buf.size()); |
| 35 | } |
| 36 | catch (RootException const & e) |
| 37 | { |
| 38 | LOG(LERROR, ("Failed to build traffic keys:", e.Msg())); |
| 39 | return false; |
| 40 | } |
| 41 | |
| 42 | return true; |
| 43 | } |
| 44 | } // namespace traffic |
no test coverage detected