| 40 | } |
| 41 | |
| 42 | std::pair<MwmSet::MwmId, MwmSet::RegResult> FeaturesFetcher::RegisterMap(LocalCountryFile const & localFile) |
| 43 | { |
| 44 | try |
| 45 | { |
| 46 | auto result = m_dataSource.RegisterMap(localFile); |
| 47 | if (result.second != MwmSet::RegResult::Success) |
| 48 | { |
| 49 | LOG(LWARNING, ("Can't add map", localFile.GetCountryName(), "(", result.second, ").", |
| 50 | "Probably it's already added or has newer data version.")); |
| 51 | } |
| 52 | else |
| 53 | { |
| 54 | MwmSet::MwmId const & id = result.first; |
| 55 | ASSERT(id.IsAlive(), ()); |
| 56 | m_rect.Add(id.GetInfo()->m_bordersRect); |
| 57 | } |
| 58 | |
| 59 | return result; |
| 60 | } |
| 61 | catch (RootException const & ex) |
| 62 | { |
| 63 | LOG(LERROR, ("IO error while adding", localFile.GetCountryName(), "map.", ex.Msg())); |
| 64 | return std::make_pair(MwmSet::MwmId(), MwmSet::RegResult::BadFile); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | bool FeaturesFetcher::DeregisterMap(CountryFile const & countryFile) |
| 69 | { |