MCPcopy Create free account
hub / github.com/comaps/comaps / RegisterMap

Method RegisterMap

libs/map/features_fetcher.cpp:42–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42std::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
68bool FeaturesFetcher::DeregisterMap(CountryFile const & countryFile)
69{

Callers

nothing calls this directly

Calls 6

ASSERTFunction · 0.85
MwmIdClass · 0.85
GetCountryNameMethod · 0.45
IsAliveMethod · 0.45
AddMethod · 0.45
GetInfoMethod · 0.45

Tested by

no test coverage detected