24#ifndef DOWNLOADOPTIONS_H_
25#define DOWNLOADOPTIONS_H_
40 return BoolToString(second);
50 return std::to_string(second);
59 return std::to_string(second);
69 return std::to_string(second);
87 if (second == URISelector::inorder) {
89 }
else if (second == URISelector::feedback) {
91 }
else if (second == URISelector::adaptive) {
103 if (second == ProxyMethod::get) {
105 }
else if (second == ProxyMethod::tunnel) {
117 if (second == CryptoLevel::plain) {
119 }
else if (second == CryptoLevel::arc4) {
129 MetalinkProtocol second;
132 if (second == MetalinkProtocol::http) {
134 }
else if (second == MetalinkProtocol::https) {
136 }
else if (second == MetalinkProtocol::ftp) {
138 }
else if (second == MetalinkProtocol::none) {
148 FileAllocation second;
151 if (second == FileAllocation::none) {
153 }
else if (second == FileAllocation::prealloc) {
155 }
else if (second == FileAllocation::falloc) {
157 }
else if (second == FileAllocation::trunc) {
170 if (second == FTPType::binary) {
172 }
else if (second == FTPType::ascii) {
182 PieceSelectionAlgorithm second;
185 if (second == PieceSelectionAlgorithm::def) {
187 }
else if (second == PieceSelectionAlgorithm::inorder) {
189 }
else if (second == PieceSelectionAlgorithm::geom) {
191 }
else if (second == PieceSelectionAlgorithm::random) {
204 Json::Value uris(Json::arrayValue);
205 for(
auto const &x : second) {
206 uris.append(x.c_str());
220using namespace jsonrpc;
237 Json::Value m_options;
275 void setDir(std::string value);
282 void setFtpType(FTPType value);
283 void setFileAllocation(FileAllocation value);
284 void setMetalinkPreferredProtocol(MetalinkProtocol value);
285 void setStreamPieceSelector(PieceSelectionAlgorithm value);
286 void setProxyMethod(ProxyMethod value);
287 void setUriSelector(URISelector value);
288 void setAllowOverwrite(
bool value);
289 void setAllowPieceLengthChange(
bool value);
290 void setAlwaysResume(
bool value);
291 void setAsyncDns(
bool value);
292 void setAutoFileRenaming(
bool value);
293 void setBtEnableHookAfterHashCheck(
bool value);
294 void setBtEnablelpd(
bool value);
295 void setBtForceEncryption(
bool value);
296 void setBtHashCheckSeed(
bool value);
297 void setBtLoadSavedMetadata(
bool value);
298 void setBtMetadataOnly(
bool value);
299 void setBtRequireCrypto(
bool value);
300 void setBtSaveMetadata(
bool value);
301 void setBtSeedUnverified(
bool value);
302 void setBtStopTimeout(
bool value);
303 void setCheckIntegrity(
bool value);
304 void setConditionalGet(
bool value);
305 void setCont(
bool value);
306 void setEnableHttpKeepAlive(
bool value);
307 void setEnableHttpPipelining(
bool value);
308 void setEnableMmap(
bool value);
309 void setEnablePeerExchange(
bool value);
310 void setFollowMetalink(
bool value);
311 void setFollowTorrent(
bool value);
312 void setFtpPasv(
bool value);
313 void setFtpReuseConnection(
bool value);
314 void setHashCheckOnly(
bool value);
315 void setHttpAcceptGzip(
bool value);
316 void setHttpAuthChallenge(
bool value);
317 void setHttpNoCache(
bool value);
318 void setMetalinkEnableUniqueProtocol(
bool value);
319 void setNoNetrc(
bool value);
320 void setParameterizedUri(
bool value);
321 void setPause(
bool value);
322 void setPauseMetadata(
bool value);
323 void setRealtimeChunkChecksum(
bool value);
324 void setRemoteTime(
bool value);
325 void setRemoveControlFile(
bool value);
326 void setReuseUri(
bool value);
327 void setUseHead(
bool value);
328 void setSeedRatio(
float value);
329 void setSeedTime(
float value);
330 void setBtTrackerConnectTimeout(
int value);
331 void setBtTrackerInterval(
int value);
332 void setBtTrackerTimeout(
int value);
333 void setConnectTimeout(
int value);
334 void setLowestSpeedLimit(
int value);
335 void setMaxConnectionPerServer(
int value);
336 void setMaxResumeFailureTries(
int value);
337 void setMaxTries(
int value);
338 void setRetryWait(
int value);
339 void setSplit(
int value);
340 void setStop(
int value);
341 void setTimeout(
int value);
342 void setMaxMmapLimit(
size_t value);
343 void setMinSplitSize(
size_t value);
344 void setNoFileAllocationLimit(
size_t value);
345 void setBtTracker(stringList value);
346 void setBtExternalIp(std::string value);
347 void setFtpPasswd(std::string value);
348 void setFtpProxy(std::string value);
349 void setFtpProxyPasswd(std::string value);
350 void setFtpProxyUser(std::string value);
351 void setFtpUser(std::string value);
352 void setGid(std::string value);
353 void setHttpPasswd(std::string value);
354 void setHttpProxy(std::string value);
355 void setHttpProxyPasswd(std::string value);
356 void setHttpProxyUser(std::string value);
357 void setHttpUser(std::string value);
358 void setHttpsProxy(std::string value);
359 void setHttpsProxyPasswd(std::string value);
360 void setHttpsProxyUser(std::string value);
361 void setMetalinkLanguage(std::string value);
362 void setMetalinkLocation(std::string value);
363 void setMetalinkOs(std::string value);
364 void setMetalinkVersion(std::string value);
365 void setOut(std::string value);
366 void setUserAgent(std::string value);
377 bool getDryRun()
const;
395 std::string
getDir()
const;
397 CryptoLevel getBtMinCryptoLevel()
const;
398 FTPType getFtpType()
const;
399 FileAllocation getFileAllocation()
const;
400 MetalinkProtocol getMetalinkPreferredProtocol()
const;
401 PieceSelectionAlgorithm getStreamPieceSelector()
const;
402 ProxyMethod getProxyMethod()
const;
403 URISelector getUriSelector()
const;
404 bool getAllowOverwrite()
const;
405 bool getAllowPieceLengthChange()
const;
406 bool getAlwaysResume()
const;
407 bool getAsyncDns()
const;
408 bool getAutoFileRenaming()
const;
409 bool getBtEnableHookAfterHashCheck()
const;
410 bool getBtEnablelpd()
const;
411 bool getBtForceEncryption()
const;
412 bool getBtHashCheckSeed()
const;
413 bool getBtLoadSavedMetadata()
const;
414 bool getBtMetadataOnly()
const;
415 bool getBtRequireCrypto()
const;
416 bool getBtSaveMetadata()
const;
417 bool getBtSeedUnverified()
const;
418 bool getBtStopTimeout()
const;
419 bool getCheckIntegrity()
const;
420 bool getConditionalGet()
const;
421 bool getCont()
const;
422 bool getEnableHttpKeepAlive()
const;
423 bool getEnableHttpPipelining()
const;
424 bool getEnableMmap()
const;
425 bool getEnablePeerExchange()
const;
426 bool getFollowMetalink()
const;
427 bool getFollowTorrent()
const;
428 bool getFtpPasv()
const;
429 bool getFtpReuseConnection()
const;
430 bool getHashCheckOnly()
const;
431 bool getHttpAcceptGzip()
const;
432 bool getHttpAuthChallenge()
const;
433 bool getHttpNoCache()
const;
434 bool getMetalinkEnableUniqueProtocol()
const;
435 bool getNoNetrc()
const;
436 bool getParameterizedUri()
const;
437 bool getPause()
const;
438 bool getPauseMetadata()
const;
439 bool getRealtimeChunkChecksum()
const;
440 bool getRemoteTime()
const;
441 bool getRemoveControlFile()
const;
442 bool getReuseUri()
const;
443 bool getUseHead()
const;
444 float getSeedRatio()
const;
445 float getSeedTime()
const;
446 int getBtTrackerConnectTimeout()
const;
447 int getBtTrackerInterval()
const;
448 int getBtTrackerTimeout()
const;
449 int getConnectTimeout()
const;
450 int getLowestSpeedLimit()
const;
451 int getMaxConnectionPerServer()
const;
452 int getMaxResumeFailureTries()
const;
453 int getMaxTries()
const;
454 int getRetryWait()
const;
455 int getSplit()
const;
457 int getTimeout()
const;
458 size_t getMaxMmapLimit()
const;
459 size_t getMinSplitSize()
const;
460 size_t getNoFileAllocationLimit()
const;
461 std::string getBtExternalIp()
const;
462 std::string getFtpPasswd()
const;
463 std::string getFtpProxy()
const;
464 std::string getFtpProxyPasswd()
const;
465 std::string getFtpProxyUser()
const;
466 std::string getFtpUser()
const;
467 std::string getGid()
const;
468 std::string getHttpPasswd()
const;
469 std::string getHttpProxy()
const;
470 std::string getHttpProxyPasswd()
const;
471 std::string getHttpProxyUser()
const;
472 std::string getHttpUser()
const;
473 std::string getHttpsProxy()
const;
474 std::string getHttpsProxyPasswd()
const;
475 std::string getHttpsProxyUser()
const;
476 std::string getMetalinkLanguage()
const;
477 std::string getMetalinkLocation()
const;
478 std::string getMetalinkOs()
const;
479 std::string getMetalinkVersion()
const;
480 std::string getOut()
const;
481 std::string getUserAgent()
const;
482 stringList getBtTracker()
const;
Definition: downloadoptions.h:235
void setMaxUploadLimit(int value)
Definition: downloadoptions.cpp:890
void setDryRun(bool value)
Definition: downloadoptions.cpp:876
bool getForceSave() const
Definition: downloadoptions.cpp:374
void setBtMaxPeers(int value)
void setBtRemoveUnselectedFile(bool value)
Definition: downloadoptions.cpp:855
std::string getDir() const
Definition: downloadoptions.cpp:385
void setPieceLength(int value)
Definition: downloadoptions.cpp:869
int getMaxDownloadLimit() const
Definition: downloadoptions.cpp:353
int getBtMaxPeers() const
Definition: downloadoptions.cpp:364
int getBtRequestPeerSpeedLimit() const
Definition: downloadoptions.cpp:358
void setMaxDownloadLimit(int value)
Definition: downloadoptions.cpp:841
void setRpcSaveUploadMetadata(bool value)
Definition: downloadoptions.cpp:862
bool getRpcSaveUploadMetadata() const
Definition: downloadoptions.cpp:369
int getMaxUploadLimit() const
Definition: downloadoptions.cpp:348
size_t getPieceLength() const
Definition: downloadoptions.cpp:343
bool update()
Definition: downloadoptions.cpp:34
DownloadOptions()
Definition: downloadoptions.cpp:27
void setForceSave(bool value)
Definition: downloadoptions.cpp:848
bool getBtRemoveUnselectedFile() const
Definition: downloadoptions.cpp:390
void setBtRequestPeerSpeedLimit(int value)
Definition: downloadoptions.cpp:897
Json::Value asJsonArray()
Definition: downloadoptions.cpp:42
void setDir(std::string value)
Definition: downloadoptions.cpp:883
void setBtMinCryptoLevel(CryptoLevel value)
Definition: downloadoptions.cpp:904
Definition: download.h:39
Definition: downloadoptions.h:112
Definition: downloadoptions.h:165
Definition: downloadoptions.h:146
Definition: downloadoptions.h:180
Definition: downloadoptions.h:98
Definition: downloadoptions.h:82
Definition: downloadoptions.h:35
Definition: downloadoptions.h:45
Definition: downloadoptions.h:54
Definition: downloadoptions.h:64
Definition: downloadoptions.h:199
Definition: downloadoptions.h:73