diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-05-14 23:00:21 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-05-14 23:00:21 +0900 |
| commit | 5dcc2b7842120222f6e15db37e7c9d7f8d73c797 (patch) | |
| tree | 6f1fd32f206b0cd44b4f63e398b9368554bda0e3 /src/includes | |
| parent | b0b5e0df3803d0a92b0412717b53ae8924905a07 (diff) | |
Add DownloadHandle::getBtMetaInfo() API
Diffstat (limited to 'src/includes')
| -rw-r--r-- | src/includes/aria2/aria2.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/includes/aria2/aria2.h b/src/includes/aria2/aria2.h index 86ef420d..4929576b 100644 --- a/src/includes/aria2/aria2.h +++ b/src/includes/aria2/aria2.h @@ -450,6 +450,55 @@ struct FileData { /** * @enum * + * BitTorrent file mode + */ +enum BtFileMode { + /** + * Indicating single file torrent + */ + BT_FILE_MODE_SINGLE, + /** + * Indicating multi file torrent + */ + BT_FILE_MODE_MULTI +}; + +/** + * @struct + * + * BitTorrent metainfo data retrieved from ".torrent" file. + */ +struct BtMetaInfoData { + /** + * List of lists of announce URI. If ".torrent" file contains + * ``announce`` and no ``announce-list``, ``announce`` is converted + * to ``announce-list`` format. + */ + std::vector<std::vector<std::string> > announceList; + /** + * ``comment`` for the torrent. ``comment.utf-8`` is used if + * available. + */ + std::string comment; + /** + * The creation time of the torrent. The value is an integer since + * the Epoch, measured in seconds. + */ + time_t creationDate; + /** + * File mode of the torrent. + */ + BtFileMode mode; + /** + * ``name`` in ``info`` dictionary. ``name.utf-8`` is used if + * available. + */ + std::string name; +}; + +/** + * @enum + * * The status of download item. */ enum DownloadStatus { @@ -579,6 +628,13 @@ public: * is out-of-bound. */ virtual FileData getFile(int index) = 0; + /** + * Returns the information retrieved from ".torrent" file. This + * function is only meaningful only when BitTorrent transfer is + * involved in the download and the download is not + * stopped/completed. + */ + virtual BtMetaInfoData getBtMetaInfo() = 0; }; /** |
