mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 15:12:30 +00:00
Working on sessions.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@291 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "download.h"
|
||||
#include "session_manager.h"
|
||||
|
||||
namespace core {
|
||||
|
||||
void
|
||||
SessionManager::activate(const std::string& path) {
|
||||
m_path = path;
|
||||
|
||||
if (m_path.empty())
|
||||
throw std::logic_error("core::SessionManager::activate(...) received an empty path");
|
||||
|
||||
if (m_path.rbegin() != '/')
|
||||
m_path += '/';
|
||||
}
|
||||
|
||||
void
|
||||
SessionManager::disable() {
|
||||
m_path = "";
|
||||
}
|
||||
|
||||
void
|
||||
SessionManager::save(Download* d) {
|
||||
std::fstream f(
|
||||
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SessionManager::remove(Download* d) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef RTORRENT_CORE_SESSION_MANAGER_H
|
||||
#define RTORRENT_CORE_SESSION_MANAGER_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace core {
|
||||
|
||||
class Download;
|
||||
|
||||
class SessionManager {
|
||||
public:
|
||||
|
||||
void activate(const std::string& path);
|
||||
void disable();
|
||||
|
||||
bool is_active() { return !m_path.empty(); }
|
||||
|
||||
void save(Download* d);
|
||||
void remove(Download* d);
|
||||
|
||||
private:
|
||||
std::string m_path;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user