mcloud
1.0.0
MCloud API library for cmcc cloud service
|
UploadTask is a task item that can be accessed from application layer to fetch basic upload item information, also it's used for content upload by sync manager. More...
#include <uploadtask.h>
Public Types | |
typedef std::shared_ptr< UploadTask > | Ptr |
![]() | |
enum | Status { Status::Unstart, Status::Running, Status::Canceled, Status::Paused, Status::Broken, Status::Complete } |
The Status enum indicates current status of this task. More... | |
typedef std::function< void(float)> | ProgressHandler |
typedef std::function< void(Status)> | StatusHandler |
typedef std::function< size_t(void *dest, size_t buf_size)> | Buffer_Callback |
Public Member Functions | |
virtual | ~UploadTask ()=default |
UploadTask (const UploadTask &)=delete | |
UploadTask & | operator= (const UploadTask &)=delete |
const std::string & | task_id () const override |
Returns an unique id of upload task. More... | |
const std::string & | content_id () const override |
Returns an unique id of cloud content on mcloud. More... | |
const std::string & | content_name () const override |
Returns a display name of local content. More... | |
const std::string & | file_path () const override |
Returns uploaded local content file path. More... | |
const std::string & | error_string () const override |
Contains the error string if an error occurs during content uploading. More... | |
const std::string & | task_url () const override |
Returns upload url assigned by mcloud for this task. More... | |
Task::Status | status () const override |
Returns current sync-up status for this task. More... | |
Task::ProgressHandler & | progress_changed () override |
Handler for upload progress of a task. More... | |
Task::StatusHandler & | status_changed () override |
Handler for upload status of a task. More... | |
void | cancel () override |
cancel the task. More... | |
size_t | file_size () const |
Returns file size of upload content. More... | |
bool | is_need_upload () const |
Returns true if a uploaded item does not exist in cloud, otherwise return false. More... | |
![]() | |
virtual | ~Task ()=default |
Friends | |
class | SyncManagerPriv |
UploadTask is a task item that can be accessed from application layer to fetch basic upload item information, also it's used for content upload by sync manager.
Definition at line 66 of file uploadtask.h.
typedef std::shared_ptr<UploadTask> mcloud::api::UploadTask::Ptr |
Definition at line 68 of file uploadtask.h.
|
virtualdefault |
|
delete |
|
overridevirtual |
|
overridevirtual |
Returns an unique id of cloud content on mcloud.
Implements mcloud::api::Task.
|
overridevirtual |
Returns a display name of local content.
Implements mcloud::api::Task.
|
overridevirtual |
Contains the error string if an error occurs during content uploading.
Implements mcloud::api::Task.
|
overridevirtual |
Returns uploaded local content file path.
Implements mcloud::api::Task.
size_t mcloud::api::UploadTask::file_size | ( | ) | const |
Returns file size of upload content.
bool mcloud::api::UploadTask::is_need_upload | ( | ) | const |
Returns true if a uploaded item does not exist in cloud, otherwise return false.
|
delete |
|
overridevirtual |
|
overridevirtual |
Returns current sync-up status for this task.
Implements mcloud::api::Task.
|
overridevirtual |
|
overridevirtual |
Returns an unique id of upload task.
Implements mcloud::api::Task.
|
overridevirtual |
Returns upload url assigned by mcloud for this task.
Implements mcloud::api::Task.
|
friend |
Definition at line 143 of file uploadtask.h.