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

Method CountrySizeInBytes

libs/storage/storage.cpp:692–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690}
691
692LocalAndRemoteSize Storage::CountrySizeInBytes(CountryId const & countryId) const
693{
694 LocalFilePtr localFile = GetLatestLocalFile(countryId);
695 CountryFile const & countryFile = GetCountryFile(countryId);
696 LocalAndRemoteSize sizes(0, GetRemoteSize(countryFile));
697
698 if (!IsCountryInQueue(countryId) && !IsDiffApplyingInProgressToCountry(countryId))
699 sizes.first = localFile ? localFile->GetSize(MapFileType::Map) : 0;
700
701 auto const it = m_downloadingCountries.find(countryId);
702 if (it != m_downloadingCountries.cend())
703 sizes.first = it->second.m_bytesDownloaded;
704
705 return sizes;
706}
707
708CountryFile const & Storage::GetCountryFile(CountryId const & countryId) const
709{

Callers 5

mainFunction · 0.80
UNIT_TESTFunction · 0.80

Calls 4

GetRemoteSizeFunction · 0.85
GetSizeMethod · 0.45
findMethod · 0.45
cendMethod · 0.45

Tested by 3

UNIT_TESTFunction · 0.64