⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 torrent.xml

📁 LibTorrent is a BitTorrent library written in C++ for *nix, with a focus on high performance and goo
💻 XML
字号:
<chapter id="torrent">  <title>Torrent</title><section id="state"><title>State</title><section id="closed"><title>Closed</title><para>This is the initial state of a download. When switching to this mode,all tracker requests are closed and the bitfield of completed chunksis cleared. File paths can only be changed in this state. Functionsfor getting information on bitfields, chunk count and various otherswill return size 0 in this state. (TODO: Check which)</para><para><blockquote><programlisting>torrent::Download::is_open() == false;torrent::Download::is_active() == false;torrent::Download::is_tracker_busy() == false;</programlisting></blockquote></para></section><section id="open"> <title>Open</title><para>This is the state after a successfull call totorrent::Download::open(). This function throws torrent::local_errorif the download could not be opened. All files in the download havebeen created and are open. The initial hash check must be done to geta valid bitfield of completed chunks.</para><para><blockquote><programlisting>torrent::Download::is_open() == true;torrent::Download::is_active() == false;</programlisting></blockquote></para></section><section id="active"> <title>Active</title><para>A download is active after calling torrent::Download::start(). Onlydownloads that are in an open state and has a valid bitfield ofcompleted chunks can be activated.</para><para><blockquote><programlisting>torrent::Download::is_open() == true;torrent::Download::is_active() == true;torrent::Download::is_hash_checked() == true;</programlisting></blockquote></para><para>A tracker request will be made when torrent::Download::stop() iscalled on an active download. It is not required to wait for thetracker request to finish before calling torrent::Download::close(),but it is recommened so the tracker knows this client is not available.</para></section></section><section id="file-paths"><title>File Paths</title><para>The paths of files in a Download consists of two parts, theroot directory and the paths of each file. The file paths are readfrom the torrent file and the files usually reside in the rootdirectory. The root directory is by default "./" for single filetorrents and "./[torrent_name]/" for multi-file torrents.</para><para><blockquote><programlisting>// Get and set the root directory.std::string    torrent::Download::get_root_dir();void           torrent::Download::set_root_dir(const std::string& dir);// Get the torrent::Entry class for each file in the download.torrent::Entry torrent::Download::get_entry(uint32_t index);uint32_t       torrent::Download::get_entry_size();typedef std::list&lt;std::string> torrent::Entry::Path;// Get and set the file path.std::string    torrent::Entry::get_path();const Path&    torrent::Entry::get_path_list();void           torrent::Entry::set_path_list(const Path& l);</programlisting></blockquote></para><para>The modifications can only be done while the download is in aclosed state. Modifying the file paths will not change the "info hash"part of the bencode'd torrent associated with the download. (TODO:When exporting, save root directory and file paths to another sectionof the torrent)</para></section></chapter>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -