mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Add Downloader bindings
This commit is contained in:
@@ -86,6 +86,18 @@ namespace cocos2d { namespace network {
|
||||
int errorCode,
|
||||
int errorCodeInternal,
|
||||
const std::string& errorStr)> onTaskError;
|
||||
|
||||
void setOnFileTaskSuccess(const std::function<void(const DownloadTask& task)>& callback) {onFileTaskSuccess = callback;};
|
||||
|
||||
void setOnTaskProgress(const std::function<void(const DownloadTask& task,
|
||||
int64_t bytesReceived,
|
||||
int64_t totalBytesReceived,
|
||||
int64_t totalBytesExpected)>& callback) {onTaskProgress = callback;};
|
||||
|
||||
void setOnTaskError(const std::function<void(const DownloadTask& task,
|
||||
int errorCode,
|
||||
int errorCodeInternal,
|
||||
const std::string& errorStr)>& callback) {onTaskError = callback;};
|
||||
|
||||
std::shared_ptr<const DownloadTask> createDownloadDataTask(const std::string& srcUrl, const std::string& identifier = "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user