* New non-template VariableStringSlot and VariableValueSlot.

* Support B, K, M and G in options.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@670 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-04-20 20:03:03 +00:00
parent 2f6b5affd1
commit c4256079ae
15 changed files with 427 additions and 179 deletions
+14 -6
View File
@@ -37,25 +37,33 @@
#ifndef RTORRENT_UTILS_VARIABLE_H
#define RTORRENT_UTILS_VARIABLE_H
#include <string>
namespace torrent {
class Object;
}
#include <torrent/object.h>
namespace utils {
class Variable {
public:
typedef torrent::Object::value_type value_type;
typedef torrent::Object::string_type string_type;
typedef torrent::Object::list_type list_type;
typedef torrent::Object::map_type map_type;
typedef torrent::Object::key_type key_type;
Variable() {}
virtual ~Variable() {}
virtual const torrent::Object& get() = 0;
virtual void set(const torrent::Object& arg) = 0;
virtual void set(const torrent::Object& arg) = 0;
protected:
Variable(const Variable&);
void operator = (const Variable&);
static const char* string_to_value_unit(const char* pos, value_type* value, int base, int unit);
// Temporary hack, until torrent::Object is extended to allow
// references so we can return a copy, not a const reference.
static const torrent::Object m_emptyObject;
};
}