MCPcopy Create free account
hub / github.com/axmolengine/axmol / createDownloadFileTask

Method createDownloadFileTask

core/network/Downloader.cpp:158–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158std::shared_ptr<DownloadTask> Downloader::createDownloadFileTask(std::string_view srcUrl,
159 std::string_view storagePath,
160 std::string_view identifier,
161 std::string_view md5checksum,
162 bool background,
163 std::string_view cacertPath)
164{
165 auto task = std::make_shared<DownloadTask>(srcUrl, storagePath, md5checksum, identifier, background, cacertPath);
166 do
167 {
168 if (srcUrl.empty() || storagePath.empty())
169 {
170 if (onTaskError)
171 {
172 onTaskError(*task, DownloadTask::ERROR_INVALID_PARAMS, 0, "URL or storage path is empty.");
173 }
174 task.reset();
175 break;
176 }
177 _impl->startTask(task);
178 } while (0);
179
180 return task;
181}
182
183// std::string Downloader::getFileNameFromUrl(std::string_view srcUrl)
184//{

Callers 7

onEnterMethod · 0.80
onEnterMethod · 0.80
downloadVersionMethod · 0.80
downloadManifestMethod · 0.80
queueDowloadMethod · 0.80
AssetsManagerMethod · 0.80

Calls 3

emptyMethod · 0.45
resetMethod · 0.45
startTaskMethod · 0.45

Tested by 2

onEnterMethod · 0.64
onEnterMethod · 0.64