2023-11-01 21:11:11 +00:00
|
|
|
// This file Copyright © Mnemosyne LLC.
|
2022-08-08 18:05:39 +00:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 18:27:56 +00:00
|
|
|
// or any future license endorsed by Mnemosyne LLC.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2008-04-13 14:29:11 +00:00
|
|
|
|
2017-11-14 20:21:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
2008-11-24 20:17:36 +00:00
|
|
|
#ifndef __TRANSMISSION__
|
2017-04-19 12:04:45 +00:00
|
|
|
#error only libtransmission should #include this header.
|
2008-11-24 20:17:36 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-09 02:25:19 +00:00
|
|
|
#include <cstdint> // uint64_t
|
2021-12-15 21:25:42 +00:00
|
|
|
|
2023-11-23 05:41:12 +00:00
|
|
|
#include "libtransmission/transmission.h"
|
|
|
|
|
|
|
|
#include "libtransmission/torrent.h"
|
2020-08-11 18:11:55 +00:00
|
|
|
|
2022-02-09 02:25:19 +00:00
|
|
|
namespace tr_resume
|
2008-04-13 14:29:11 +00:00
|
|
|
{
|
2022-02-09 02:25:19 +00:00
|
|
|
|
|
|
|
using fields_t = uint64_t;
|
|
|
|
|
|
|
|
auto inline constexpr Downloaded = fields_t{ 1 << 0 };
|
|
|
|
auto inline constexpr Uploaded = fields_t{ 1 << 1 };
|
|
|
|
auto inline constexpr Corrupt = fields_t{ 1 << 2 };
|
|
|
|
auto inline constexpr Peers = fields_t{ 1 << 3 };
|
|
|
|
auto inline constexpr Progress = fields_t{ 1 << 4 };
|
|
|
|
auto inline constexpr Dnd = fields_t{ 1 << 5 };
|
|
|
|
auto inline constexpr FilePriorities = fields_t{ 1 << 6 };
|
|
|
|
auto inline constexpr BandwidthPriority = fields_t{ 1 << 7 };
|
|
|
|
auto inline constexpr Speedlimit = fields_t{ 1 << 8 };
|
|
|
|
auto inline constexpr Run = fields_t{ 1 << 9 };
|
|
|
|
auto inline constexpr DownloadDir = fields_t{ 1 << 10 };
|
|
|
|
auto inline constexpr IncompleteDir = fields_t{ 1 << 11 };
|
|
|
|
auto inline constexpr MaxPeers = fields_t{ 1 << 12 };
|
|
|
|
auto inline constexpr AddedDate = fields_t{ 1 << 13 };
|
|
|
|
auto inline constexpr DoneDate = fields_t{ 1 << 14 };
|
|
|
|
auto inline constexpr ActivityDate = fields_t{ 1 << 15 };
|
|
|
|
auto inline constexpr Ratiolimit = fields_t{ 1 << 16 };
|
|
|
|
auto inline constexpr Idlelimit = fields_t{ 1 << 17 };
|
|
|
|
auto inline constexpr TimeSeeding = fields_t{ 1 << 18 };
|
|
|
|
auto inline constexpr TimeDownloading = fields_t{ 1 << 19 };
|
|
|
|
auto inline constexpr Filenames = fields_t{ 1 << 20 };
|
|
|
|
auto inline constexpr Name = fields_t{ 1 << 21 };
|
|
|
|
auto inline constexpr Labels = fields_t{ 1 << 22 };
|
2022-03-18 13:11:59 +00:00
|
|
|
auto inline constexpr Group = fields_t{ 1 << 23 };
|
2024-03-31 20:01:05 +00:00
|
|
|
auto inline constexpr SequentialDownload = fields_t{ 1 << 24 };
|
2022-02-09 02:25:19 +00:00
|
|
|
|
|
|
|
auto inline constexpr All = ~fields_t{ 0 };
|
|
|
|
|
2023-11-26 21:43:37 +00:00
|
|
|
fields_t load(tr_torrent* tor, tr_torrent::ResumeHelper& helper, fields_t fields_to_load, tr_ctor const& ctor);
|
2022-02-09 02:25:19 +00:00
|
|
|
|
2023-11-23 05:41:12 +00:00
|
|
|
void save(tr_torrent* tor, tr_torrent::ResumeHelper const& helper);
|
2022-02-09 02:25:19 +00:00
|
|
|
|
|
|
|
} // namespace tr_resume
|