* Moving download variables into command_download.cc.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@902 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-05-18 14:24:57 +00:00
parent 9fe72cb3b5
commit 7d1bb524ba
14 changed files with 243 additions and 175 deletions
+19
View File
@@ -36,6 +36,7 @@
#include "config.h"
#include "core/download.h"
#include "utils/parse.h"
#include "command_download_slot.h"
@@ -140,4 +141,22 @@ CommandDownloadSlot::call_string(Variable* rawVariable, core::Download* download
// return variable->m_variable;
// }
torrent::Object
set_variable_d_fn_t::operator () (core::Download* download, const torrent::Object& arg1) {
if (m_firstKey == NULL)
download->bencode()->get_key(m_secondKey) = arg1;
else
download->bencode()->get_key(m_firstKey).get_key(m_secondKey) = arg1;
return torrent::Object();
}
torrent::Object
get_variable_d_fn_t::operator () (core::Download* download, const torrent::Object& arg1) {
if (m_firstKey == NULL)
return download->bencode()->get_key(m_secondKey);
else
return download->bencode()->get_key(m_firstKey).get_key(m_secondKey);
}
}