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

Method SyncWithDisk

libs/platform/local_country_file.cpp:27–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25{}
26
27void LocalCountryFile::SyncWithDisk()
28{
29 // World files from resources have an empty directory. See todo in the header.
30 if (m_directory.empty())
31 return;
32
33 m_files = {};
34 uint64_t size = 0;
35
36 // Now we are not working with several files at the same time and diffs have greater priority.
37 Platform & platform = GetPlatform();
38 for (MapFileType type : {MapFileType::Diff, MapFileType::Map})
39 {
40 auto const ut = base::Underlying(type);
41 ASSERT_LESS(ut, m_files.size(), ());
42
43 if (platform.GetFileSizeByFullPath(GetPath(type), size))
44 {
45 m_files[ut] = size;
46 break;
47 }
48 }
49}
50
51void LocalCountryFile::DeleteFromDisk(MapFileType type) const
52{

Callers 15

mainFunction · 0.80
LoadDataSourcesFunction · 0.80
SingleMwmDataSourceMethod · 0.80
ForEachMWMFunction · 0.80
FinishMethod · 0.80
InitDataSourceFunction · 0.80
DeleteAllLocalMapsMethod · 0.80
RegisterAllLocalMapsMethod · 0.80
RegisterCountryFilesMethod · 0.80
RegisterLocalFileMethod · 0.80
DeleteCountryFilesMethod · 0.80
ApplyDiffFunction · 0.80

Calls 5

UnderlyingFunction · 0.85
GetPathFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
GetFileSizeByFullPathMethod · 0.45

Tested by 5

FinishMethod · 0.64
CreateDummyMapFileFunction · 0.64
UNIT_TESTFunction · 0.64
UNIT_TESTFunction · 0.64
GetAllLocalFilesFunction · 0.64