download progress meter
More...
#include <cupt/download/progress.hpp>
◆ finishedDownloadHook()
virtual void cupt::download::Progress::finishedDownloadHook |
( |
const string & |
uri, |
|
|
const string & |
result |
|
) |
| |
|
protectedvirtual |
This hook is called when some download is finished.
- Parameters
-
uri | |
result | download exit code, empty string is success, non-empty string is human-readable download error message |
Reimplemented in cupt::download::ConsoleProgress.
◆ finishHook()
virtual void cupt::download::Progress::finishHook |
( |
| ) |
|
|
protectedvirtual |
◆ getDownloadRecords()
const std::map< string, DownloadRecord >& cupt::download::Progress::getDownloadRecords |
( |
| ) |
const |
|
protected |
Gets current downloads.
- Returns
- map of uris to download records.
◆ getDownloadSpeed()
size_t cupt::download::Progress::getDownloadSpeed |
( |
| ) |
const |
|
protected |
- Returns
- current download speed in bytes/second
◆ getLongAliasForUri()
string cupt::download::Progress::getLongAliasForUri |
( |
const string & |
uri | ) |
const |
|
protected |
- Parameters
-
- Returns
- long alias for uri if it was specified, uri otherwise
◆ getOverallDownloadedSize()
uint64_t cupt::download::Progress::getOverallDownloadedSize |
( |
| ) |
const |
|
protected |
- Returns
- the sum of already done downloads in the current session plus the sum of downloaded parts of running downloads
◆ getOverallDownloadTime()
size_t cupt::download::Progress::getOverallDownloadTime |
( |
| ) |
const |
|
protected |
- Returns
- number of seconds since the start of the download session
◆ getOverallEstimatedSize()
uint64_t cupt::download::Progress::getOverallEstimatedSize |
( |
| ) |
const |
|
protected |
Overall estimated size is guaranteed to be not less than getOverallDownloadedSize.
- Returns
- total estimated size counting both done and running downloads
◆ getOverallEstimatedTime()
size_t cupt::download::Progress::getOverallEstimatedTime |
( |
| ) |
const |
|
protected |
- Returns
- number of seconds, estimated time to finish since the start of the download session
◆ getOverallFetchedSize()
uint64_t cupt::download::Progress::getOverallFetchedSize |
( |
| ) |
const |
|
protected |
- Returns
- total byte count of all data chunks fetched from the network (or its equivalent)
◆ getShortAliasForUri()
string cupt::download::Progress::getShortAliasForUri |
( |
const string & |
uri | ) |
const |
|
protected |
- Parameters
-
- Returns
- short alias for uri if it was specified, uri otherwise
◆ isOptional()
bool cupt::download::Progress::isOptional |
( |
const string & |
uri | ) |
const |
|
protected |
◆ markAsOptional()
void cupt::download::Progress::markAsOptional |
( |
const string & |
uri | ) |
|
Notify that a failure to download uri is not an error.
- Parameters
-
◆ newDownloadHook()
virtual void cupt::download::Progress::newDownloadHook |
( |
const string & |
uri, |
|
|
const DownloadRecord & |
downloadRecord |
|
) |
| |
|
protectedvirtual |
◆ setLongAliasForUri()
void cupt::download::Progress::setLongAliasForUri |
( |
const string & |
uri, |
|
|
const string & |
alias |
|
) |
| |
sets a long alias for URI
- Parameters
-
◆ setShortAliasForUri()
void cupt::download::Progress::setShortAliasForUri |
( |
const string & |
uri, |
|
|
const string & |
alias |
|
) |
| |
sets a short alias for URI
- Parameters
-
◆ updateHook()
virtual void cupt::download::Progress::updateHook |
( |
bool |
immediate | ) |
|
|
protectedvirtual |
This hook is called whenever some download information is updated (including being called after newDownloadHook and finishedDownloadHook).
- Parameters
-
immediate | is update important or not; examples of important updates: new download, finished download, changes of a download state; examples of unimportant updates: number of download bytes changes for some download |
Reimplemented in cupt::download::ConsoleProgress.
◆ speedCalculatingAccuracy
float cupt::download::Progress::speedCalculatingAccuracy |
|
static |
amount of seconds considered while calculating a download speed
Default: 16
The documentation for this class was generated from the following file: