* Make VariableMap handle both global and core::Download

variables. Variable now has functions for both void and
core::Download*, where the core::Download* is discarded if necessary.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@847 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-01-17 15:18:33 +00:00
parent d030c5401e
commit e59b5bf7b6
19 changed files with 414 additions and 133 deletions
+10 -2
View File
@@ -39,6 +39,10 @@
#include <torrent/object.h>
namespace core {
class Download;
}
namespace utils {
class Variable {
@@ -52,8 +56,12 @@ public:
Variable() {}
virtual ~Variable() {}
virtual const torrent::Object& get() = 0;
virtual void set(const torrent::Object& arg) = 0;
virtual const torrent::Object& get();
virtual void set(const torrent::Object& arg);
// The default action is to throw away the 'download' argument.
virtual const torrent::Object& get_d(core::Download* download);
virtual void set_d(core::Download* download, const torrent::Object& arg);
static const char* string_to_value_unit(const char* pos, value_type* value, int base, int unit);
static bool string_to_value_unit_nothrow(const char* pos, value_type* value, int base, int unit);