| 1571 | } |
| 1572 | |
| 1573 | void RoutingManager::SaveRoutePoints() |
| 1574 | { |
| 1575 | auto points = GetRoutePointsToSave(); |
| 1576 | if (points.empty()) |
| 1577 | { |
| 1578 | DeleteSavedRoutePoints(); |
| 1579 | return; |
| 1580 | } |
| 1581 | |
| 1582 | GetPlatform().RunTask(Platform::Thread::File, [points = std::move(points)]() |
| 1583 | { |
| 1584 | try |
| 1585 | { |
| 1586 | auto const fileName = GetPlatform().SettingsPathForFile(kRoutePointsFile); |
| 1587 | FileWriter writer(fileName); |
| 1588 | string const pointsData = SerializeRoutePoints(points); |
| 1589 | writer.Write(pointsData.c_str(), pointsData.length()); |
| 1590 | } |
| 1591 | catch (RootException const & ex) |
| 1592 | { |
| 1593 | LOG(LWARNING, ("Saving road points failed:", ex.Msg())); |
| 1594 | } |
| 1595 | }); |
| 1596 | } |
| 1597 | |
| 1598 | vector<RouteMarkData> RoutingManager::GetRoutePointsToSave() const |
| 1599 | { |
no test coverage detected