#ifndef _TR_TEST_TORRENT_CONTEXT_HPP_ #define _TR_TEST_TORRENT_CONTEXT_HPP_ #include #include class InfoHash { private: std::string hash; public: InfoHash(const std::string &h) : hash(h) {} std::string to_string() { return hash; } }; class TorrentStatus { public: bool paused = false; bool is_seeding = false; int state = 0; int priority = 0; std::string name = "Arch"; std::string save_path; }; class TestTorrent { public: TestTorrent(const libtorrent::add_torrent_params ¶ms) : hash(params.info_hash.to_string()) { status_.save_path = params.save_path; } TestTorrent() : hash("12a") {} bool is_valid(); InfoHash info_hash(); TorrentStatus status(int type = 0); int query_name = 1; int query_save_path = 2; bool valid = true; InfoHash hash; TorrentStatus status_; }; #endif