mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-21 00:26:16 +00:00
Run multiple session save requests in parallel.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#ifndef RTORRENT_SESSION_DOWNLOAD_STORER_H
|
||||
#define RTORRENT_SESSION_DOWNLOAD_STORER_H
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <torrent/common.h>
|
||||
|
||||
namespace core {
|
||||
class Download;
|
||||
}
|
||||
|
||||
namespace utils {
|
||||
class Directory;
|
||||
}
|
||||
|
||||
namespace session {
|
||||
|
||||
class DownloadStorer {
|
||||
public:
|
||||
DownloadStorer(core::Download* download);
|
||||
|
||||
core::Download* download() const { return m_download; }
|
||||
|
||||
void build_streams(bool skip_static);
|
||||
std::string build_path(const std::string& session_path);
|
||||
|
||||
auto torrent_stream() { return std::move(m_torrent_stream); }
|
||||
auto rtorrent_stream() { return std::move(m_rtorrent_stream); }
|
||||
auto libtorrent_stream() { return std::move(m_libtorrent_stream); }
|
||||
|
||||
static utils::Directory get_formated_entries(const std::string& session_path);
|
||||
|
||||
private:
|
||||
core::Download* m_download;
|
||||
|
||||
std::unique_ptr<std::stringstream> m_torrent_stream;
|
||||
std::unique_ptr<std::stringstream> m_rtorrent_stream;
|
||||
std::unique_ptr<std::stringstream> m_libtorrent_stream;
|
||||
};
|
||||
|
||||
} // namespace session
|
||||
|
||||
#endif // RTORRENT_SESSION_DOWNLOAD_STORER_H
|
||||
Reference in New Issue
Block a user