| 75 | } |
| 76 | |
| 77 | bool IsFileDownloaded(string const fileDownloadPath, MapFileType type) |
| 78 | { |
| 79 | // Since a downloaded valid diff file may be either with .diff or .diff.ready extension, |
| 80 | // we have to check these both cases in order to find |
| 81 | // the diff file which is ready to apply. |
| 82 | // If there is such a file we have to cause the success download scenario. |
| 83 | string const readyFilePath = fileDownloadPath; |
| 84 | bool isDownloadedDiff = false; |
| 85 | if (type == MapFileType::Diff) |
| 86 | { |
| 87 | string filePath = readyFilePath; |
| 88 | base::GetNameWithoutExt(filePath); |
| 89 | isDownloadedDiff = GetPlatform().IsFileExistsByFullPath(filePath); |
| 90 | } |
| 91 | |
| 92 | // It may happen that the file already was downloaded, so there is |
| 93 | // no need to request servers list and download file. Let's |
| 94 | // switch to next file. |
| 95 | return isDownloadedDiff || GetPlatform().IsFileExistsByFullPath(readyFilePath); |
| 96 | } |
| 97 | } // namespace |
| 98 | |
| 99 | CountriesSet GetQueuedCountries(QueueInterface const & queue) |
no test coverage detected