libaria2cpp 0.2.0
Basic CPP library to connect to an ARIA2 daemon via the RPC interface.
Public Member Functions | Public Attributes | List of all members
DownloadOptions Class Reference

#include <downloadoptions.h>

Public Member Functions

 DownloadOptions ()
 
bool update ()
 
Json::Value asJsonArray ()
 
void setBtMaxPeers (int value)
 
void setBtRemoveUnselectedFile (bool value)
 
void setForceSave (bool value)
 
void setMaxDownloadLimit (int value)
 
void setMaxUploadLimit (int value)
 
void setPieceLength (int value)
 
void setRpcSaveUploadMetadata (bool value)
 
void setBtRequestPeerSpeedLimit (int value)
 
void setDryRun (bool value)
 
void setDir (std::string value)
 
void setBtMinCryptoLevel (CryptoLevel value)
 
void setFtpType (FTPType value)
 
void setFileAllocation (FileAllocation value)
 
void setMetalinkPreferredProtocol (MetalinkProtocol value)
 
void setStreamPieceSelector (PieceSelectionAlgorithm value)
 
void setProxyMethod (ProxyMethod value)
 
void setUriSelector (URISelector value)
 
void setAllowOverwrite (bool value)
 
void setAllowPieceLengthChange (bool value)
 
void setAlwaysResume (bool value)
 
void setAsyncDns (bool value)
 
void setAutoFileRenaming (bool value)
 
void setBtEnableHookAfterHashCheck (bool value)
 
void setBtEnablelpd (bool value)
 
void setBtForceEncryption (bool value)
 
void setBtHashCheckSeed (bool value)
 
void setBtLoadSavedMetadata (bool value)
 
void setBtMetadataOnly (bool value)
 
void setBtRequireCrypto (bool value)
 
void setBtSaveMetadata (bool value)
 
void setBtSeedUnverified (bool value)
 
void setBtStopTimeout (bool value)
 
void setCheckIntegrity (bool value)
 
void setConditionalGet (bool value)
 
void setCont (bool value)
 
void setEnableHttpKeepAlive (bool value)
 
void setEnableHttpPipelining (bool value)
 
void setEnableMmap (bool value)
 
void setEnablePeerExchange (bool value)
 
void setFollowMetalink (bool value)
 
void setFollowTorrent (bool value)
 
void setFtpPasv (bool value)
 
void setFtpReuseConnection (bool value)
 
void setHashCheckOnly (bool value)
 
void setHttpAcceptGzip (bool value)
 
void setHttpAuthChallenge (bool value)
 
void setHttpNoCache (bool value)
 
void setMetalinkEnableUniqueProtocol (bool value)
 
void setNoNetrc (bool value)
 
void setParameterizedUri (bool value)
 
void setPause (bool value)
 
void setPauseMetadata (bool value)
 
void setRealtimeChunkChecksum (bool value)
 
void setRemoteTime (bool value)
 
void setRemoveControlFile (bool value)
 
void setReuseUri (bool value)
 
void setUseHead (bool value)
 
void setSeedRatio (float value)
 
void setSeedTime (float value)
 
void setBtTrackerConnectTimeout (int value)
 
void setBtTrackerInterval (int value)
 
void setBtTrackerTimeout (int value)
 
void setConnectTimeout (int value)
 
void setLowestSpeedLimit (int value)
 
void setMaxConnectionPerServer (int value)
 
void setMaxResumeFailureTries (int value)
 
void setMaxTries (int value)
 
void setRetryWait (int value)
 
void setSplit (int value)
 
void setStop (int value)
 
void setTimeout (int value)
 
void setMaxMmapLimit (size_t value)
 
void setMinSplitSize (size_t value)
 
void setNoFileAllocationLimit (size_t value)
 
void setBtTracker (stringList value)
 
void setBtExternalIp (std::string value)
 
void setFtpPasswd (std::string value)
 
void setFtpProxy (std::string value)
 
void setFtpProxyPasswd (std::string value)
 
void setFtpProxyUser (std::string value)
 
void setFtpUser (std::string value)
 
void setGid (std::string value)
 
void setHttpPasswd (std::string value)
 
void setHttpProxy (std::string value)
 
void setHttpProxyPasswd (std::string value)
 
void setHttpProxyUser (std::string value)
 
void setHttpUser (std::string value)
 
void setHttpsProxy (std::string value)
 
void setHttpsProxyPasswd (std::string value)
 
void setHttpsProxyUser (std::string value)
 
void setMetalinkLanguage (std::string value)
 
void setMetalinkLocation (std::string value)
 
void setMetalinkOs (std::string value)
 
void setMetalinkVersion (std::string value)
 
void setOut (std::string value)
 
void setUserAgent (std::string value)
 
bool getDryRun () const
 
bool getForceSave () const
 
bool getRpcSaveUploadMetadata () const
 
int getBtMaxPeers () const
 
int getBtRequestPeerSpeedLimit () const
 
int getMaxDownloadLimit () const
 
int getMaxUploadLimit () const
 
size_t getPieceLength () const
 
bool getBtRemoveUnselectedFile () const
 
std::string getDir () const
 
CryptoLevel getBtMinCryptoLevel () const
 
FTPType getFtpType () const
 
FileAllocation getFileAllocation () const
 
MetalinkProtocol getMetalinkPreferredProtocol () const
 
PieceSelectionAlgorithm getStreamPieceSelector () const
 
ProxyMethod getProxyMethod () const
 
URISelector getUriSelector () const
 
bool getAllowOverwrite () const
 
bool getAllowPieceLengthChange () const
 
bool getAlwaysResume () const
 
bool getAsyncDns () const
 
bool getAutoFileRenaming () const
 
bool getBtEnableHookAfterHashCheck () const
 
bool getBtEnablelpd () const
 
bool getBtForceEncryption () const
 
bool getBtHashCheckSeed () const
 
bool getBtLoadSavedMetadata () const
 
bool getBtMetadataOnly () const
 
bool getBtRequireCrypto () const
 
bool getBtSaveMetadata () const
 
bool getBtSeedUnverified () const
 
bool getBtStopTimeout () const
 
bool getCheckIntegrity () const
 
bool getConditionalGet () const
 
bool getCont () const
 
bool getEnableHttpKeepAlive () const
 
bool getEnableHttpPipelining () const
 
bool getEnableMmap () const
 
bool getEnablePeerExchange () const
 
bool getFollowMetalink () const
 
bool getFollowTorrent () const
 
bool getFtpPasv () const
 
bool getFtpReuseConnection () const
 
bool getHashCheckOnly () const
 
bool getHttpAcceptGzip () const
 
bool getHttpAuthChallenge () const
 
bool getHttpNoCache () const
 
bool getMetalinkEnableUniqueProtocol () const
 
bool getNoNetrc () const
 
bool getParameterizedUri () const
 
bool getPause () const
 
bool getPauseMetadata () const
 
bool getRealtimeChunkChecksum () const
 
bool getRemoteTime () const
 
bool getRemoveControlFile () const
 
bool getReuseUri () const
 
bool getUseHead () const
 
float getSeedRatio () const
 
float getSeedTime () const
 
int getBtTrackerConnectTimeout () const
 
int getBtTrackerInterval () const
 
int getBtTrackerTimeout () const
 
int getConnectTimeout () const
 
int getLowestSpeedLimit () const
 
int getMaxConnectionPerServer () const
 
int getMaxResumeFailureTries () const
 
int getMaxTries () const
 
int getRetryWait () const
 
int getSplit () const
 
int getStop () const
 
int getTimeout () const
 
size_t getMaxMmapLimit () const
 
size_t getMinSplitSize () const
 
size_t getNoFileAllocationLimit () const
 
std::string getBtExternalIp () const
 
std::string getFtpPasswd () const
 
std::string getFtpProxy () const
 
std::string getFtpProxyPasswd () const
 
std::string getFtpProxyUser () const
 
std::string getFtpUser () const
 
std::string getGid () const
 
std::string getHttpPasswd () const
 
std::string getHttpProxy () const
 
std::string getHttpProxyPasswd () const
 
std::string getHttpProxyUser () const
 
std::string getHttpUser () const
 
std::string getHttpsProxy () const
 
std::string getHttpsProxyPasswd () const
 
std::string getHttpsProxyUser () const
 
std::string getMetalinkLanguage () const
 
std::string getMetalinkLocation () const
 
std::string getMetalinkOs () const
 
std::string getMetalinkVersion () const
 
std::string getOut () const
 
std::string getUserAgent () const
 
stringList getBtTracker () const
 

Public Attributes

Json::Value m_options
 

Detailed Description

This class contains options which are specific to a download. The meaning of each option is not described here in detail. To get further details, look at the Options class, and find the exact analogue of the settting there. DownloadOptions is for the most part, a subset of Options. Any DownloadOptions specific settings are explained here. This is the object to create and set should you wish to set options specific to a new download, or query an existing downloads settings. If you don't set a particular option, then aria2 will either use the globally set option, if one is set, or its own default.

Constructor & Destructor Documentation

◆ DownloadOptions()

DownloadOptions::DownloadOptions ( )

Constructor. Constructs a new "DownloadOptions" object. This object will contain no initial settings.

Member Function Documentation

◆ asJsonArray()

Json::Value DownloadOptions::asJsonArray ( )
Returns
The configuration as a Json Array.

Aira2 option dry-run.

Aria2 option force-save.

Aria2 option rpc-save-upload-metadata.

Aria2 option bt-max-peers.

Aria2 option bt-request-peer-speed-limit.

Aria2 option max-download-limit.

Aria2 option max-upload-limit.

Aria2 option piece-length.

Aria2 option bt-remove-unselected-file.

Aria2 option dir.

Aria2 option allow-overwrite.

Aria2 option allow-piece.

Aria2 option always-resume.

Aria2 option async-dns.

Aria2 option auto-file.

Aria2 option bt-enable-lpd.

Aria2 option bt-force-encryption.

Aria2 option bt-hash-check-seed.

Aria2 option bt-load-saved-metadata.

Aria2 option bt-metadata-only.

Aria2 option bt-enable-hook-after-hash-check.

Aria2 option bt-exclude-tracker.

Aria2 option bt-min-crypto-level.

Aria2 option bt-require-crypto.

Aria2 option bt-save-metadata.

Aria2 option bt-seed-unverified.

Aria2 option bt-stop-timeout.

Aria2 option bt-tracker.

Aria2 option bt-tracker-connect-timeout.

Aria2 option bt-tracker-interval.

Aria2 option bt-tracker-timeout.

Aria2 option check-integrity.

Aria2 option conditional-get.

Aria2 option connect-timeout.

Aria2 option continue.

Aria2 option enable-http-keep-alive.

Aria2 option enable-http-pipelining.

Aria2 option enable-mmap.

Aria2 option enable-peer-exchange.

Aria2 option file-allocation.

Aria2 option follow-metalink.

Aria2 option follow-torrent.

Aria2 option ftp-user.

Aria2 option ftp-passwd.

Aria2 option ftp-proxy.

Aria2 option ftp-proxy-passwd.

Aria2 option ftp-proxy-user.

Aria2 option ftp-reuse-connection.

Aria2 option ftp-type.

Aria2 option ftp-pasv.

Aria2 option gid.

Aria2 option hash-check-only.

Aria2 option http-accept-gzip.

Aria2 option http-auth-challenge.

Aria2 option http-no-cache.

Aria2 option http-user.

Aria2 option http-passwd.

Aria2 option http-proxy.

Aria2 option http-proxy-passwd.

Aria2 option http-proxy-user.

Aria2 option https-proxy.

Aria2 option https-proxy-passwd.

Aria2 option https-proxy-user.

Aria2 option lowest-speed-limit.

Aria2 option max-connection-per-server.

Aria2 option max-mmap-limit.

Aria2 option max-resume-failure-tries.

Aria2 option max-tries.

Aria2 option metalink-enable-unique-protocol.

Aria2 option metalink-language.

Aria2 option metalink-location.

Aria2 option metalink-os.

Aria2 option metalink-preferred-protocol.

Aria2 option metalink-version.

Aria2 option min-split-size.

Aria2 option no-file-allocation-limit.

Aria2 option no-netrc.

Aria2 option out.

Aria2 option parameterized-uri.

Aria2 option pause.

Aria2 option pause-metadata.

Aria2 option proxy-method.

Aria2 option realtime-chunk-checksum.

Aria2 option remote-time.

Aria2 option remove-control-file.

Aria2 option retry-wait.

Aria2 option reuse-uri.

Aria2 option seed-ratio.

Aria2 option seed-time.

Aria2 option seed-time.

Aria2 option split.

Aria2 option stream-piece-selector.

Aria2 option timeout.

Aria2 option uri-selector.

Aria2 option use-head.

Aria2 option user-agent.

◆ getBtMaxPeers()

int DownloadOptions::getBtMaxPeers ( ) const
Returns
Maxumum number of peers.

◆ getBtRemoveUnselectedFile()

bool DownloadOptions::getBtRemoveUnselectedFile ( ) const
Returns
Whether to remove unselected files of a BitTorrent download,

◆ getBtRequestPeerSpeedLimit()

int DownloadOptions::getBtRequestPeerSpeedLimit ( ) const
Returns
Speed limits for peers in bytes/sec

◆ getDir()

std::string DownloadOptions::getDir ( ) const
Returns
Get directory files are being saved into

◆ getForceSave()

bool DownloadOptions::getForceSave ( ) const
Returns
Whether force-save is set

◆ getMaxDownloadLimit()

int DownloadOptions::getMaxDownloadLimit ( ) const
Returns
Maximum download speed per each download in bytes/second.

◆ getMaxUploadLimit()

int DownloadOptions::getMaxUploadLimit ( ) const
Returns
Maximum upload speed per each download in bytes/second.

◆ getPieceLength()

size_t DownloadOptions::getPieceLength ( ) const
Returns
Piece length for HTTP/FTP downloads in bytes.

◆ getRpcSaveUploadMetadata()

bool DownloadOptions::getRpcSaveUploadMetadata ( ) const
Returns
Whether upload metadata is saved to a file.

◆ setBtMaxPeers()

void DownloadOptions::setBtMaxPeers ( int  value)
Parameters
[in]valueThe maximum number of peers.

◆ setBtMinCryptoLevel()

void DownloadOptions::setBtMinCryptoLevel ( CryptoLevel  value)
Returns
Whether dry-run is set

◆ setBtRemoveUnselectedFile()

void DownloadOptions::setBtRemoveUnselectedFile ( bool  value)
Parameters
[in]valueWhether to remove the unselected files when the download is completed in BitTorrent.

◆ setBtRequestPeerSpeedLimit()

void DownloadOptions::setBtRequestPeerSpeedLimit ( int  value)
Parameters
[in]valueIf the whole download speed of every torrent is lower than SPEED, aria2 temporarily increases the number of peers to try for more download speed.

◆ setDir()

void DownloadOptions::setDir ( std::string  value)
Parameters
[in]dirDirectory to save files into.

◆ setDryRun()

void DownloadOptions::setDryRun ( bool  value)
Parameters
[in]_dryRunWhether to add downloads as a 'Dry Run' or not.

◆ setForceSave()

void DownloadOptions::setForceSave ( bool  value)
Parameters
[in]valueWhether to save the download with the save-session option even if the file is completed or removed.

◆ setMaxDownloadLimit()

void DownloadOptions::setMaxDownloadLimit ( int  value)
Parameters
[in]valueThe maximum download speed per each download in bytes/second.

◆ setMaxUploadLimit()

void DownloadOptions::setMaxUploadLimit ( int  value)
Parameters
[in]valueThe maximum upload speed per each download in bytes/second.

◆ setPieceLength()

void DownloadOptions::setPieceLength ( int  value)
Parameters
[in]valuePiece length for HTTP/FTP protocols. This is the boundary when aria2 splits a file . All splits occur at multiple of this length. This is ignored for BitTorrent downloads.

◆ setRpcSaveUploadMetadata()

void DownloadOptions::setRpcSaveUploadMetadata ( bool  value)
Parameters
[in]valueIf true, the uploaded data is saved as a file named as the hex string of SHA-1 hash of data plus ".torrent" in the directory specified by dir option.

◆ update()

bool DownloadOptions::update ( )

Is this an active download?

Returns
Whether there is an active download associated with this configuration.

The documentation for this class was generated from the following files: