qBittorrent
serialize_torrent.h
Go to the documentation of this file.
1 /*
2  * Bittorrent Client using Qt and libtorrent.
3  * Copyright (C) 2018 Vladimir Golovnev <glassez@yandex.ru>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  * In addition, as a special exception, the copyright holders give permission to
20  * link this program with the OpenSSL project's "OpenSSL" library (or with
21  * modified versions of it that use the same license as the "OpenSSL" library),
22  * and distribute the linked executables. You must obey the GNU General Public
23  * License in all respects for all of the code used other than "OpenSSL". If you
24  * modify file(s), you may extend this exception to your version of the file(s),
25  * but you are not obligated to do so. If you do not wish to do so, delete this
26  * exception statement from your version.
27  */
28 
29 #pragma once
30 
31 #include <QVariant>
32 
33 namespace BitTorrent
34 {
35  class Torrent;
36 }
37 
38 // Torrent keys
39 // TODO: Rename it to `id`.
40 inline const char KEY_TORRENT_ID[] = "hash";
41 inline const char KEY_TORRENT_INFOHASHV1[] = "infohash_v1";
42 inline const char KEY_TORRENT_INFOHASHV2[] = "infohash_v2";
43 inline const char KEY_TORRENT_NAME[] = "name";
44 inline const char KEY_TORRENT_MAGNET_URI[] = "magnet_uri";
45 inline const char KEY_TORRENT_SIZE[] = "size";
46 inline const char KEY_TORRENT_PROGRESS[] = "progress";
47 inline const char KEY_TORRENT_DLSPEED[] = "dlspeed";
48 inline const char KEY_TORRENT_UPSPEED[] = "upspeed";
49 inline const char KEY_TORRENT_QUEUE_POSITION[] = "priority";
50 inline const char KEY_TORRENT_SEEDS[] = "num_seeds";
51 inline const char KEY_TORRENT_NUM_COMPLETE[] = "num_complete";
52 inline const char KEY_TORRENT_LEECHS[] = "num_leechs";
53 inline const char KEY_TORRENT_NUM_INCOMPLETE[] = "num_incomplete";
54 inline const char KEY_TORRENT_RATIO[] = "ratio";
55 inline const char KEY_TORRENT_ETA[] = "eta";
56 inline const char KEY_TORRENT_STATE[] = "state";
57 inline const char KEY_TORRENT_SEQUENTIAL_DOWNLOAD[] = "seq_dl";
58 inline const char KEY_TORRENT_FIRST_LAST_PIECE_PRIO[] = "f_l_piece_prio";
59 inline const char KEY_TORRENT_CATEGORY[] = "category";
60 inline const char KEY_TORRENT_TAGS[] = "tags";
61 inline const char KEY_TORRENT_SUPER_SEEDING[] = "super_seeding";
62 inline const char KEY_TORRENT_FORCE_START[] = "force_start";
63 inline const char KEY_TORRENT_SAVE_PATH[] = "save_path";
64 inline const char KEY_TORRENT_DOWNLOAD_PATH[] = "download_path";
65 inline const char KEY_TORRENT_CONTENT_PATH[] = "content_path";
66 inline const char KEY_TORRENT_ADDED_ON[] = "added_on";
67 inline const char KEY_TORRENT_COMPLETION_ON[] = "completion_on";
68 inline const char KEY_TORRENT_TRACKER[] = "tracker";
69 inline const char KEY_TORRENT_TRACKERS_COUNT[] = "trackers_count";
70 inline const char KEY_TORRENT_DL_LIMIT[] = "dl_limit";
71 inline const char KEY_TORRENT_UP_LIMIT[] = "up_limit";
72 inline const char KEY_TORRENT_AMOUNT_DOWNLOADED[] = "downloaded";
73 inline const char KEY_TORRENT_AMOUNT_UPLOADED[] = "uploaded";
74 inline const char KEY_TORRENT_AMOUNT_DOWNLOADED_SESSION[] = "downloaded_session";
75 inline const char KEY_TORRENT_AMOUNT_UPLOADED_SESSION[] = "uploaded_session";
76 inline const char KEY_TORRENT_AMOUNT_LEFT[] = "amount_left";
77 inline const char KEY_TORRENT_AMOUNT_COMPLETED[] = "completed";
78 inline const char KEY_TORRENT_MAX_RATIO[] = "max_ratio";
79 inline const char KEY_TORRENT_MAX_SEEDING_TIME[] = "max_seeding_time";
80 inline const char KEY_TORRENT_RATIO_LIMIT[] = "ratio_limit";
81 inline const char KEY_TORRENT_SEEDING_TIME_LIMIT[] = "seeding_time_limit";
82 inline const char KEY_TORRENT_LAST_SEEN_COMPLETE_TIME[] = "seen_complete";
83 inline const char KEY_TORRENT_LAST_ACTIVITY_TIME[] = "last_activity";
84 inline const char KEY_TORRENT_TOTAL_SIZE[] = "total_size";
85 inline const char KEY_TORRENT_AUTO_TORRENT_MANAGEMENT[] = "auto_tmm";
86 inline const char KEY_TORRENT_TIME_ACTIVE[] = "time_active";
87 inline const char KEY_TORRENT_SEEDING_TIME[] = "seeding_time";
88 inline const char KEY_TORRENT_AVAILABILITY[] = "availability";
89 
90 QVariantMap serialize(const BitTorrent::Torrent &torrent);
const char KEY_TORRENT_LAST_SEEN_COMPLETE_TIME[]
const char KEY_TORRENT_AMOUNT_UPLOADED[]
const char KEY_TORRENT_AMOUNT_DOWNLOADED[]
const char KEY_TORRENT_INFOHASHV1[]
const char KEY_TORRENT_AMOUNT_COMPLETED[]
const char KEY_TORRENT_AVAILABILITY[]
const char KEY_TORRENT_MAX_RATIO[]
const char KEY_TORRENT_AUTO_TORRENT_MANAGEMENT[]
const char KEY_TORRENT_SUPER_SEEDING[]
const char KEY_TORRENT_PROGRESS[]
const char KEY_TORRENT_INFOHASHV2[]
const char KEY_TORRENT_COMPLETION_ON[]
const char KEY_TORRENT_SEEDING_TIME_LIMIT[]
const char KEY_TORRENT_QUEUE_POSITION[]
const char KEY_TORRENT_TOTAL_SIZE[]
const char KEY_TORRENT_ADDED_ON[]
const char KEY_TORRENT_DL_LIMIT[]
const char KEY_TORRENT_TAGS[]
QVariantMap serialize(const BitTorrent::Torrent &torrent)
const char KEY_TORRENT_DOWNLOAD_PATH[]
const char KEY_TORRENT_NUM_COMPLETE[]
const char KEY_TORRENT_RATIO_LIMIT[]
const char KEY_TORRENT_TRACKERS_COUNT[]
const char KEY_TORRENT_FORCE_START[]
const char KEY_TORRENT_UP_LIMIT[]
const char KEY_TORRENT_LAST_ACTIVITY_TIME[]
const char KEY_TORRENT_STATE[]
const char KEY_TORRENT_SAVE_PATH[]
const char KEY_TORRENT_NUM_INCOMPLETE[]
const char KEY_TORRENT_ID[]
const char KEY_TORRENT_SEEDS[]
const char KEY_TORRENT_MAX_SEEDING_TIME[]
const char KEY_TORRENT_NAME[]
const char KEY_TORRENT_ETA[]
const char KEY_TORRENT_CATEGORY[]
const char KEY_TORRENT_SEEDING_TIME[]
const char KEY_TORRENT_DLSPEED[]
const char KEY_TORRENT_CONTENT_PATH[]
const char KEY_TORRENT_SEQUENTIAL_DOWNLOAD[]
const char KEY_TORRENT_RATIO[]
const char KEY_TORRENT_AMOUNT_LEFT[]
const char KEY_TORRENT_TRACKER[]
const char KEY_TORRENT_AMOUNT_UPLOADED_SESSION[]
const char KEY_TORRENT_AMOUNT_DOWNLOADED_SESSION[]
const char KEY_TORRENT_TIME_ACTIVE[]
const char KEY_TORRENT_LEECHS[]
const char KEY_TORRENT_SIZE[]
const char KEY_TORRENT_UPSPEED[]
const char KEY_TORRENT_FIRST_LAST_PIECE_PRIO[]
const char KEY_TORRENT_MAGNET_URI[]