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

Function IsFileDownloaded

libs/storage/storage.cpp:77–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77bool 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
99CountriesSet GetQueuedCountries(QueueInterface const & queue)

Callers 1

DownloadCountryMethod · 0.85

Calls 2

GetNameWithoutExtFunction · 0.85

Tested by

no test coverage detected