mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 11:42:33 +00:00
* 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:
+14
-6
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user