Cupt
Public Member Functions | Static Protected Member Functions | List of all members
cupt::download::Method Class Referenceabstract

base class of download methods More...

#include <cupt/download/method.hpp>

Public Member Functions

virtual string perform (const Config &config, const Uri &uri, const string &targetPath, const std::function< void(const vector< string > &) > &callback)=0
 downloads uri to targetPath More...
 

Static Protected Member Functions

static string getAcquireSuboptionForUri (const Config &config, const Uri &uri, const string &suboptionName)
 gets URI-specific value of some 'acquire::*' option More...
 
static ssize_t getIntegerAcquireSuboptionForUri (const Config &config, const Uri &uri, const string &suboptionName)
 gets URI-specific value of some integer 'acquire::*' option More...
 

Detailed Description

base class of download methods

Member Function Documentation

◆ getAcquireSuboptionForUri()

static string cupt::download::Method::getAcquireSuboptionForUri ( const Config config,
const Uri uri,
const string &  suboptionName 
)
staticprotected

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.

Parameters
config
uri
suboptionName
Example:
auto proxy = getAcquireSuboptionForUri(config, uri, "proxy");

◆ getIntegerAcquireSuboptionForUri()

static ssize_t cupt::download::Method::getIntegerAcquireSuboptionForUri ( const Config config,
const Uri uri,
const string &  suboptionName 
)
staticprotected

gets URI-specific value of some integer 'acquire::*' option

Same as getAcquireSuboptionForUri, but for integer options.

Parameters
config
uri
suboptionName

◆ perform()

virtual string cupt::download::Method::perform ( const Config config,
const Uri uri,
const string &  targetPath,
const std::function< void(const vector< string > &) > &  callback 
)
pure virtual

downloads uri to targetPath

Parameters
config
uri
targetPathpath to download to
callbackcallback function
Allowed callback sequences:
downloading total_downloaded_bytes size_of_last_fetched_piece
expected-size expected_file_size

The documentation for this class was generated from the following file:
cupt::download::Method::getAcquireSuboptionForUri
static string getAcquireSuboptionForUri(const Config &config, const Uri &uri, const string &suboptionName)
gets URI-specific value of some 'acquire::*' option