Class Download
Defined in File downloader.h
Class Documentation
-
class Download
A representation of a current download.
Downloadis not thread safe. User must care to not call method on a same download from different threads. However, it is safe to use differentDownloads from different threads.Public Types
Public Functions
-
inline Download()
-
void updateStatus(bool follow)
Update the status of the download.
This call make an aria rpc call and is blocking. Some download (started with a metalink) are in fact several downloads.
A first one to download the metadlink.
A second one to download the real file.
If
followis true, updateStatus tries to detect that and tracks the second download when the first one is finished. By passing false tofollow,Downloadwill only track the first download.getFoomethods are based on the last statusUpdate.- Parameters:
follow – Do we have to follow following downloads.
-
void pauseDownload()
Pause the download (and call updateStatus)
-
void resumeDownload()
Resume the download (and call updateStatus)
-
void cancelDownload()
Cancel the download.
A canceled downlod cannot be resume and updateStatus does nothing. However, you can still get information based on the last known information.
-
inline StatusResult getStatus() const
-
inline const std::string &getDid() const
-
inline const std::string &getFollowedBy() const
-
inline uint64_t getTotalLength() const
-
inline uint64_t getCompletedLength() const
-
inline uint64_t getDownloadSpeed() const
-
inline uint64_t getVerifiedLength() const
-
inline const std::string &getPath() const
-
inline const std::vector<std::string> &getUris() const
-
inline Download()