prefs.cc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. /* <!-- copyright */
  2. /*
  3. * aria2 - The high speed download utility
  4. *
  5. * Copyright (C) 2006 Tatsuhiro Tsujikawa
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. * In addition, as a special exception, the copyright holders give
  22. * permission to link the code of portions of this program with the
  23. * OpenSSL library under certain conditions as described in each
  24. * individual source file, and distribute linked combinations
  25. * including the two.
  26. * You must obey the GNU General Public License in all respects
  27. * for all of the code used other than OpenSSL. If you modify
  28. * file(s) with this exception, you may extend this exception to your
  29. * version of the file(s), but you are not obligated to do so. If you
  30. * do not wish to do so, delete this exception statement from your
  31. * version. If you delete this exception statement from all source
  32. * files in the program, then also delete it here.
  33. */
  34. /* copyright --> */
  35. #include "prefs.h"
  36. namespace aria2 {
  37. /**
  38. * Constants
  39. */
  40. const std::string V_TRUE("true");
  41. const std::string V_FALSE("false");
  42. const std::string V_NONE("none");
  43. const std::string V_MEM("mem");
  44. const std::string V_ALL("all");
  45. /**
  46. * General preferences
  47. */
  48. // values: 1*digit
  49. const std::string PREF_RETRY_WAIT("retry-wait");
  50. // values: 1*digit
  51. const std::string PREF_TIMEOUT("timeout");
  52. // values: 1*digit
  53. const std::string PREF_DNS_TIMEOUT("dns-timeout");
  54. // values: 1*digit
  55. const std::string PREF_CONNECT_TIMEOUT("connect-timeout");
  56. // values: 1*digit
  57. const std::string PREF_MAX_TRIES("max-tries");
  58. // values: 1*digit
  59. const std::string PREF_MIN_SEGMENT_SIZE("min-segment-size");
  60. // values: 1*digit
  61. const std::string PREF_AUTO_SAVE_INTERVAL("auto-save-interval");
  62. // values: true | false
  63. const std::string PREF_STDOUT_LOG("stdout-log");
  64. // values: a string that your file system recognizes as a file name.
  65. const std::string PREF_LOG("log");
  66. // values: a string that your file system recognizes as a directory.
  67. const std::string PREF_DIR("dir");
  68. // values: a string that your file system recognizes as a file name.
  69. const std::string PREF_OUT("out");
  70. // values: 1*digit
  71. const std::string PREF_SPLIT("split");
  72. // value: true | false
  73. const std::string PREF_DAEMON("daemon");
  74. // value: a string
  75. const std::string PREF_REFERER("referer");
  76. // value: 1*digit
  77. const std::string PREF_LOWEST_SPEED_LIMIT("lowest-speed-limit");
  78. // value: 1*digit
  79. const std::string PREF_SEGMENT_SIZE("segment-size");
  80. // value: 1*digit
  81. const std::string PREF_MAX_DOWNLOAD_LIMIT("max-download-limit");
  82. // value: 1*digit
  83. const std::string PREF_STARTUP_IDLE_TIME("startup-idle-time");
  84. // value: prealloc | none
  85. const std::string PREF_FILE_ALLOCATION("file-allocation");
  86. const std::string V_PREALLOC("prealloc");
  87. #// value: 1*digit
  88. const std::string PREF_NO_FILE_ALLOCATION_LIMIT("no-file-allocation-limit");
  89. // value: true | false
  90. const std::string PREF_ALLOW_OVERWRITE("allow-overwrite");
  91. // value: true | false
  92. const std::string PREF_REALTIME_CHUNK_CHECKSUM("realtime-chunk-checksum");
  93. // value: true | false
  94. const std::string PREF_CHECK_INTEGRITY("check-integrity");
  95. // value: string that your file system recognizes as a file name.
  96. const std::string PREF_NETRC_PATH("netrc-path");
  97. // value:
  98. const std::string PREF_CONTINUE("continue");
  99. // value:
  100. const std::string PREF_NO_NETRC("no-netrc");
  101. // value: 1*digit
  102. const std::string PREF_MAX_DOWNLOADS("max-downloads");
  103. // value: string that your file system recognizes as a file name.
  104. const std::string PREF_INPUT_FILE("input-file");
  105. // value: 1*digit
  106. const std::string PREF_MAX_CONCURRENT_DOWNLOADS("max-concurrent-downloads");
  107. // value: 1*digit
  108. const std::string PREF_DIRECT_DOWNLOAD_TIMEOUT("direct-download-timeout");
  109. // value: true | false
  110. const std::string PREF_FORCE_SEQUENTIAL("force-sequential");
  111. // value: true | false
  112. const std::string PREF_AUTO_FILE_RENAMING("auto-file-renaming");
  113. // value: true | false
  114. const std::string PREF_PARAMETERIZED_URI("parameterized-uri");
  115. // value: true | false
  116. const std::string PREF_ENABLE_DIRECT_IO("enable-direct-io");
  117. // value: true | false
  118. const std::string PREF_ALLOW_PIECE_LENGTH_CHANGE("allow-piece-length-change");
  119. // value: true | false
  120. const std::string PREF_NO_CONF("no-conf");
  121. // value: string
  122. const std::string PREF_CONF_PATH("conf-path");
  123. // value: 1*digit
  124. const std::string PREF_STOP("stop");
  125. // value: true | false
  126. const std::string PREF_QUIET("quiet");
  127. // value: true | false
  128. const std::string PREF_ASYNC_DNS("async-dns");
  129. // value: 1*digit
  130. const std::string PREF_SUMMARY_INTERVAL("summary-interval");
  131. // value: debug, info, notice, warn, error
  132. const std::string PREF_LOG_LEVEL("log-level");
  133. const std::string V_DEBUG("debug");
  134. const std::string V_INFO("info");
  135. const std::string V_NOTICE("notice");
  136. const std::string V_WARN("warn");
  137. const std::string V_ERROR("error");
  138. // value: inorder | feedback
  139. const std::string PREF_URI_SELECTOR("uri-selector");
  140. const std::string V_INORDER("inorder");
  141. const std::string V_FEEDBACK("feedback");
  142. // value: 1*digit
  143. const std::string PREF_SERVER_STAT_TIMEOUT("server-stat-timeout");
  144. // value: string that your file system recognizes as a file name.
  145. const std::string PREF_SERVER_STAT_IF("server-stat-if");
  146. // value: string that your file system recognizes as a file name.
  147. const std::string PREF_SERVER_STAT_OF("server-stat-of");
  148. // value: true | false
  149. const std::string PREF_REMOTE_TIME("remote-time");
  150. /**
  151. * FTP related preferences
  152. */
  153. const std::string PREF_FTP_USER("ftp-user");
  154. const std::string PREF_FTP_PASSWD("ftp-passwd");
  155. // values: binary | ascii
  156. const std::string PREF_FTP_TYPE("ftp-type");
  157. const std::string V_BINARY("binary");
  158. const std::string V_ASCII("ascii");
  159. // values: get | tunnel
  160. const std::string PREF_FTP_VIA_HTTP_PROXY("ftp-via-http-proxy");
  161. const std::string V_GET("get");
  162. const std::string V_TUNNEL("tunnel");
  163. // values: true | false
  164. const std::string PREF_FTP_PASV("ftp-pasv");
  165. // values: true | false
  166. const std::string PREF_FTP_REUSE_CONNECTION("ftp-reuse-connection");
  167. /**
  168. * HTTP related preferences
  169. */
  170. const std::string PREF_HTTP_USER("http-user");
  171. const std::string PREF_HTTP_PASSWD("http-passwd");
  172. // values: basic
  173. const std::string PREF_HTTP_AUTH_SCHEME("http-auth-scheme");
  174. const std::string V_BASIC("basic");
  175. // values: true | false
  176. const std::string PREF_HTTP_AUTH_ENABLED("http-auth-enabled");
  177. // values: string
  178. const std::string PREF_USER_AGENT("user-agent");
  179. // value: string that your file system recognizes as a file name.
  180. const std::string PREF_LOAD_COOKIES("load-cookies");
  181. // values: true | false
  182. const std::string PREF_ENABLE_HTTP_KEEP_ALIVE("enable-http-keep-alive");
  183. // values: true | false
  184. const std::string PREF_ENABLE_HTTP_PIPELINING("enable-http-pipelining");
  185. // value: 1*digit
  186. const std::string PREF_MAX_HTTP_PIPELINING("max-http-pipelining");
  187. // value: string
  188. const std::string PREF_HEADER("header");
  189. /**
  190. * HTTP proxy related preferences
  191. */
  192. const std::string PREF_HTTP_PROXY("http-proxy");
  193. const std::string PREF_HTTP_PROXY_USER("http-proxy-user");
  194. const std::string PREF_HTTP_PROXY_PASSWD("http-proxy-passwd");
  195. const std::string PREF_HTTP_PROXY_HOST("http-proxy-host");
  196. const std::string PREF_HTTP_PROXY_PORT("http-proxy-port");
  197. // values: get | tunnel
  198. const std::string PREF_HTTP_PROXY_METHOD("http-proxy-method");
  199. // values: true | false
  200. const std::string PREF_HTTP_PROXY_ENABLED("http-proxy-enabled");
  201. // values: true | false
  202. const std::string PREF_HTTP_PROXY_AUTH_ENABLED("http-proxy-auth-enabled");
  203. /**
  204. * BitTorrent related preferences
  205. */
  206. // values: 1*digit
  207. const std::string PREF_PEER_CONNECTION_TIMEOUT("peer-connection-timeout");
  208. // values: 1*digit
  209. const std::string PREF_BT_TIMEOUT("bt-timeout");
  210. // values: 1*digit
  211. const std::string PREF_BT_REQUEST_TIMEOUT("bt-request-timeout");
  212. // values: true | false
  213. const std::string PREF_SHOW_FILES("show-files");
  214. // values: true | false
  215. const std::string PREF_NO_PREALLOCATION("no-preallocation");
  216. // values: true | false
  217. const std::string PREF_DIRECT_FILE_MAPPING("direct-file-mapping");
  218. // values: 1*digit
  219. const std::string PREF_MAX_UPLOAD_LIMIT("max-upload-limit");
  220. // values: a string that your file system recognizes as a file name.
  221. const std::string PREF_TORRENT_FILE("torrent-file");
  222. // values: 1*digit
  223. const std::string PREF_LISTEN_PORT("listen-port");
  224. // values: true | false | mem
  225. const std::string PREF_FOLLOW_TORRENT("follow-torrent");
  226. // values: 1*digit *( (,|-) 1*digit);
  227. const std::string PREF_SELECT_FILE("select-file");
  228. // values: 1*digit
  229. const std::string PREF_SEED_TIME("seed-time");
  230. // values: 1*digit ['.' [ 1*digit ] ]
  231. const std::string PREF_SEED_RATIO("seed-ratio");
  232. // values: 1*digit
  233. const std::string PREF_TRACKER_MAX_TRIES("tracker-max-tries");
  234. // values: 1*digit
  235. const std::string PREF_BT_KEEP_ALIVE_INTERVAL("bt-keep-alive-interval");
  236. // values: a string, less than or equals to 20 bytes length
  237. const std::string PREF_PEER_ID_PREFIX("peer-id-prefix");
  238. // values: true | false
  239. const std::string PREF_ENABLE_PEER_EXCHANGE("enable-peer-exchange");
  240. // values: true | false
  241. const std::string PREF_ENABLE_DHT("enable-dht");
  242. // values: 1*digit
  243. const std::string PREF_DHT_LISTEN_PORT("dht-listen-port");
  244. // values: a string
  245. const std::string PREF_DHT_ENTRY_POINT_HOST("dht-entry-point-host");
  246. // values: 1*digit
  247. const std::string PREF_DHT_ENTRY_POINT_PORT("dht-entry-point-port");
  248. // values: a string (hostname:port);
  249. const std::string PREF_DHT_ENTRY_POINT("dht-entry-point");
  250. // values: a string
  251. const std::string PREF_DHT_FILE_PATH("dht-file-path");
  252. // values: plain | arc4
  253. const std::string PREF_BT_MIN_CRYPTO_LEVEL("bt-min-crypto-level");
  254. const std::string V_PLAIN("plain");
  255. const std::string V_ARC4("arc4");
  256. // values:: true | false
  257. const std::string PREF_BT_REQUIRE_CRYPTO("bt-require-crypto");
  258. // values: 1*digit
  259. const std::string PREF_BT_REQUEST_PEER_SPEED_LIMIT("bt-request-peer-speed-limit");
  260. // values: 1*digit
  261. const std::string PREF_BT_MAX_OPEN_FILES("bt-max-open-files");
  262. // values: true | false
  263. const std::string PREF_BT_SEED_UNVERIFIED("bt-seed-unverified");
  264. /**
  265. * Metalink related preferences
  266. */
  267. // values: a string that your file system recognizes as a file name.
  268. const std::string PREF_METALINK_FILE("metalink-file");
  269. // values: a string
  270. const std::string PREF_METALINK_VERSION("metalink-version");
  271. // values: a string
  272. const std::string PREF_METALINK_LANGUAGE("metalink-language");
  273. // values: a string
  274. const std::string PREF_METALINK_OS("metalink-os");
  275. // values: a string
  276. const std::string PREF_METALINK_LOCATION("metalink-location");
  277. // values: 1*digit
  278. const std::string PREF_METALINK_SERVERS("metalink-servers");
  279. // values: true | false | mem
  280. const std::string PREF_FOLLOW_METALINK("follow-metalink");
  281. // values: http | https | ftp | none
  282. const std::string PREF_METALINK_PREFERRED_PROTOCOL("metalink-preferred-protocol");
  283. const std::string V_HTTP("http");
  284. const std::string V_HTTPS("https");
  285. const std::string V_FTP("ftp");
  286. // values: true | false
  287. const std::string PREF_METALINK_ENABLE_UNIQUE_PROTOCOL("metalink-enable-unique-protocol");
  288. } // namespace aria2