|
std::vector< Peer > | m_peers |
|
std::vector< Servers > | m_servers |
|
◆ Download() [1/2]
Download::Download |
( |
Json::Value & |
download, |
|
|
std::vector< URI > |
urilist = std::vector<URI>() , |
|
|
Json::Value |
peers = Json::Value() , |
|
|
Json::Value |
servers = Json::Value() |
|
) |
| |
Constructor. Create a new Download from the Json::Value containing the download information.
The Json::Value struct will have been retrieved from an Aria2CPP method returning a Json::Value object or array of Json::Value objects representing downloads. This will be the typical way in which and instance the Download class is created. The URI is obtained from the getURIs method.
- Parameters
-
[in] | download | Json::Value array of download information. |
[in] | Json::Value | array of download information. |
It is generally not required to call this constructor as Aria2CPP will construct this where required.
◆ Download() [2/2]
Construct an empty Download class. This is considered to be invalid and this 'blank' Download is used to indicate an error.
◆ belongsTo()
std::string Download::belongsTo |
( |
| ) |
const |
- Returns
- The GID of the parent download.
◆ bitfield()
std::string Download::bitfield |
( |
| ) |
const |
- Returns
- Hexadecimal representation of the download progress. The highest bit corresponds to the piece at index 0. Any set bits indicate loaded pieces, while unset bits indicate not yet loaded and/or missing pieces. Any overflow bits at the end are set to zero. When the download was not started yet, this key will not be included in the response.
◆ comment()
std::string Download::comment |
( |
| ) |
const |
- Returns
- The associated comment with the download. (BitTorrent only).
◆ completedLength()
uint64_t Download::completedLength |
( |
| ) |
const |
- Returns
- Total length of what has been downloaded in bytes.
◆ connections()
size_t Download::connections |
( |
| ) |
const |
- Returns
- The number of peers/servers aria2 is connected to.
- Return values
-
[-1] | The download is not a torrent. |
◆ creationDate()
std::string Download::creationDate |
( |
| ) |
const |
- Returns
- The creation date of the Torrent. (BitTorrent only).
◆ dir()
std::string Download::dir |
( |
| ) |
const |
- Returns
- The path the downloaded file is being written into.
◆ downloadSpeed()
uint64_t Download::downloadSpeed |
( |
| ) |
const |
- Returns
- Dowload speed in bytes/second.
◆ errorCode()
std::string Download::errorCode |
( |
| ) |
const |
- Returns
- The will return the code of the last error, if there is an error.
◆ errorMessage()
std::string Download::errorMessage |
( |
| ) |
const |
- Returns
- The human readable version of the last error.
◆ eta()
int Download::eta |
( |
| ) |
const |
- Returns
- Estimated time to completion in seconds. Will return -1 if the ETA cannot be computed for whatever reason.
◆ fileList()
filelist Download::fileList |
( |
| ) |
const |
- Returns
- A filelist of all the files forming part of this download. Typically one for single URIs but likely many for torrents.
◆ followedBy()
std::string Download::followedBy |
( |
| ) |
const |
- Returns
- List of GIDs which are generated as the result of this download. This is useful to track autogenerated downloads that may arise from following a metalink.
◆ following()
std::string Download::following |
( |
| ) |
const |
◆ frontFile()
std::string Download::frontFile |
( |
| ) |
const |
- Returns
- The filename of the first file in the list. If this download is for a single file, it is the filename. This is the easiest way to get the filename of the download it if is a single file.
◆ frontPath()
std::string Download::frontPath |
( |
| ) |
const |
- Returns
- A string containing the filename and path of the first file that is being downloaded.
◆ getUris()
std::vector< URI > Download::getUris |
( |
| ) |
const |
Retrieve list of URI's from this download.
- Returns
- Vector of URI's with the relevant URI's.
- Exceptions
-
◆ gid()
std::string Download::gid |
( |
| ) |
const |
- Returns
- The GID of the download as a string.
◆ infoHash()
std::string Download::infoHash |
( |
| ) |
const |
- Returns
- Infohash (BitTorrent only).
◆ isTorrent()
bool Download::isTorrent |
( |
| ) |
const |
- Return values
-
[true] | The download is a torrent. |
[false] | The download is not a torrent. |
◆ isValid()
bool Download::isValid |
( |
| ) |
const |
This is used to determine whether this instance of Download is valid or not. Some methods of Aria2CPP will set this to "invalid" if an error is encountered when requesting a Download (such as when an invalid GID or position is specified).
- Return values
-
[true] | There is a valid download associated with this instance. |
[false] | This does not represent a valid download. |
◆ mode()
std::string Download::mode |
( |
| ) |
const |
- Returns
- The mode of the Torrent. Will be either Single or Multi. (BitTorrent only).
◆ numPieces()
size_t Download::numPieces |
( |
| ) |
const |
- Returns
- The number of pieces (BitTorrent only).
- Return values
-
[-1] | The download is not a torrent. |
◆ numSeeders()
size_t Download::numSeeders |
( |
| ) |
const |
- Returns
- The number of seeders (BitTorrent only).
◆ pieceLength()
size_t Download::pieceLength |
( |
| ) |
const |
- Returns
- Piece length in bytes (BitTorrent only).
- Return values
-
[-1] | The download is not a torrent. |
◆ seeder()
bool Download::seeder |
( |
| ) |
const |
BitTorrent only.
- Return values
-
[true] | The local endpoint is a seeder. |
[false] | The local endpoint is not a seeder. |
◆ status()
Status Download::status |
( |
| ) |
const |
- Returns
- Status of the download (active, paused, stopped)
◆ title()
std::string Download::title |
( |
| ) |
const |
- Returns
- The title of the download. For a single file, this will be the filename. For a Torrent, it will be the title of the torrent. This is the most appropriate string to use to label the download.
◆ totalLength()
uint64_t Download::totalLength |
( |
| ) |
const |
- Returns
- Total length of download in bytes.
◆ uploadSpeed()
size_t Download::uploadSpeed |
( |
| ) |
const |
- Returns
- Upload speed of the download in bytes/sec.
◆ verifiedLength()
size_t Download::verifiedLength |
( |
| ) |
const |
- Returns
- The number of verified number of bytes while the files are being hash checked. This key exists only when this download is being hash checked./
- Return values
-
[-1] | The download is not a torrent. |
◆ verifyIntegrityPending()
bool Download::verifyIntegrityPending |
( |
| ) |
const |
- Returns
- If there is a hash check in the queue.
- Return values
-
[true] | A hash check is pending. |
[false] | No has check is pending. |
The documentation for this class was generated from the following files: