mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 13:12:32 +00:00
* Added "download_list" and "download_call" options. The latter is
just a prototype, and will be changed. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@916 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -40,7 +40,10 @@
|
||||
#include <iostream>
|
||||
#include <sigc++/bind.h>
|
||||
#include <rak/functional.h>
|
||||
#include <rak/string_manip.h>
|
||||
#include <torrent/exceptions.h>
|
||||
#include <torrent/download.h>
|
||||
#include <torrent/hash_string.h>
|
||||
#include <torrent/object.h>
|
||||
#include <torrent/object_stream.h>
|
||||
#include <torrent/resume.h>
|
||||
@@ -89,6 +92,16 @@ DownloadList::session_save() {
|
||||
std::for_each(begin(), end(), std::bind1st(std::mem_fun(&DownloadStore::save), control->core()->download_store()));
|
||||
}
|
||||
|
||||
DownloadList::iterator
|
||||
DownloadList::find_hex(const char* hash) {
|
||||
torrent::HashString key;
|
||||
|
||||
for (torrent::HashString::iterator itr = key.begin(), last = key.end(); itr != last; itr++, hash += 2)
|
||||
*itr = (rak::hexchar_to_value(*hash) << 4) + rak::hexchar_to_value(*(hash + 1));
|
||||
|
||||
return std::find_if(begin(), end(), rak::equal(key, rak::on(std::mem_fun(&Download::download), std::mem_fun(&torrent::Download::info_hash))));
|
||||
}
|
||||
|
||||
Download*
|
||||
DownloadList::create(std::istream* str, bool printLog) {
|
||||
torrent::Object* object = new torrent::Object;
|
||||
|
||||
@@ -78,6 +78,8 @@ public:
|
||||
|
||||
void session_save();
|
||||
|
||||
iterator find_hex(const char* hash);
|
||||
|
||||
// Might move this to DownloadFactory.
|
||||
Download* create(std::istream* str, bool printLog);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user