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

Method DeleteCountryFiles

libs/storage/storage.cpp:1266–1290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1264}
1265
1266void Storage::DeleteCountryFiles(CountryId const & countryId, MapFileType type, bool deferredDelete)
1267{
1268 auto const it = m_localFiles.find(countryId);
1269 if (it == m_localFiles.end())
1270 return;
1271
1272 if (deferredDelete)
1273 {
1274 m_localFiles.erase(countryId);
1275 return;
1276 }
1277
1278 auto & localFiles = it->second;
1279 for (auto & localFile : localFiles)
1280 {
1281 DeleteFromDiskWithIndexes(*localFile, type);
1282 localFile->SyncWithDisk();
1283 if (!localFile->HasFiles())
1284 localFile.reset();
1285 }
1286 auto isNull = [](LocalFilePtr const & localFile) { return !localFile; };
1287 localFiles.remove_if(isNull);
1288 if (localFiles.empty())
1289 m_localFiles.erase(countryId);
1290}
1291
1292bool Storage::DeleteCountryFilesFromDownloader(CountryId const & countryId)
1293{

Callers

nothing calls this directly

Calls 8

SyncWithDiskMethod · 0.80
HasFilesMethod · 0.80
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
resetMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected