|
|
|
|
#ifndef _TR_TEST_TORRENT_CONTEXT_HPP_
|
|
|
|
|
#define _TR_TEST_TORRENT_CONTEXT_HPP_
|
|
|
|
|
|
|
|
|
|
#include <libtorrent/magnet_uri.hpp>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
class TorrentStatus {
|
|
|
|
|
public:
|
|
|
|
|
bool paused = false;
|
|
|
|
|
bool is_seeding = false;
|
|
|
|
|
bool announcing_to_dht = true;
|
|
|
|
|
int state = 0;
|
|
|
|
|
int priority = 0;
|
|
|
|
|
std::string name = "Arch";
|
|
|
|
|
std::string save_path;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class TestTorrent {
|
|
|
|
|
public:
|
|
|
|
|
TestTorrent(const libtorrent::add_torrent_params ¶ms);
|
|
|
|
|
TestTorrent() {}
|
|
|
|
|
bool is_valid();
|
|
|
|
|
libtorrent::sha1_hash info_hash() const;
|
|
|
|
|
TorrentStatus status(int type = 0);
|
|
|
|
|
int query_name = 1;
|
|
|
|
|
int query_save_path = 2;
|
|
|
|
|
bool valid = true;
|
|
|
|
|
int upload_limit_ = 0;
|
|
|
|
|
int upload_limit();
|
|
|
|
|
int download_limit_ = 0;
|
|
|
|
|
int download_limit();
|
|
|
|
|
libtorrent::sha1_hash hash_;
|
|
|
|
|
TorrentStatus status_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|