| 25 | {} |
| 26 | |
| 27 | void 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 | |
| 51 | void LocalCountryFile::DeleteFromDisk(MapFileType type) const |
| 52 | { |