base class of download methods More...
#include <cupt/download/method.hpp>
Public Member Functions | |
virtual string | perform (const shared_ptr< const Config > &config, const Uri &uri, const string &targetPath, const std::function< void(const vector< string > &) > &callback)=0 |
downloads uri to targetPath | |
Static Protected Member Functions | |
static string | getAcquireSuboptionForUri (const shared_ptr< const Config > &config, const Uri &uri, const string &suboptionName) |
gets URI-specific value of some 'acquire: :*' option | |
static ssize_t | getIntegerAcquireSuboptionForUri (const shared_ptr< const Config > &config, const Uri &uri, const string &suboptionName) |
gets URI-specific value of some integer 'acquire: :*' option |
base class of download methods
static string cupt::download::Method::getAcquireSuboptionForUri | ( | const shared_ptr< const Config > & | config, |
const Uri & | uri, | ||
const string & | suboptionName | ||
) | [static, protected] |
gets URI-specific value of some 'acquire:
:*' option
Options of Acquire
group can be overridden for specific host. This function hides the details and provides the convenient way get the value of the option in Acquire
group for certain URI.
config | |
uri | |
suboptionName |
auto proxy = getAcquireSuboptionForUri(config, uri, "proxy");
static ssize_t cupt::download::Method::getIntegerAcquireSuboptionForUri | ( | const shared_ptr< const Config > & | config, |
const Uri & | uri, | ||
const string & | suboptionName | ||
) | [static, protected] |
gets URI-specific value of some integer 'acquire:
:*' option
Same as getAcquireSuboptionForUri, but for integer options.
config | |
uri | |
suboptionName |
virtual string cupt::download::Method::perform | ( | const shared_ptr< const Config > & | config, |
const Uri & | uri, | ||
const string & | targetPath, | ||
const std::function< void(const vector< string > &) > & | callback | ||
) | [pure virtual] |
downloads uri to targetPath
config | |
uri | |
targetPath | path to download to |
callback | callback function |
downloading
total_downloaded_bytes size_of_last_fetched_piece expected-size
expected_file_size