* Bumped to 0.11.5/0.7.5.

* Added "call.set_upload_rate", "call.get_upload_rate" and
"call.get_directory" XMLRPC calls.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@888 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-04-09 21:09:53 +00:00
parent 6691298fb4
commit 8501832788
10 changed files with 164 additions and 32 deletions
+4 -4
View File
@@ -66,13 +66,13 @@ public:
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);
protected:
Variable(const Variable&);
void operator = (const Variable&);
// 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;
protected:
Variable(const Variable&);
void operator = (const Variable&);
};
}
+11 -4
View File
@@ -172,15 +172,22 @@ VariableValueSlot::get() {
}
void
VariableValueSlot::set(const torrent::Object& arg) {
VariableValueSlot::set(const torrent::Object& rawArg) {
if (!m_slotSet.is_valid())
return;
const torrent::Object* arg;
if (rawArg.type() == torrent::Object::TYPE_LIST && rawArg.as_list().size() == 1)
arg = &rawArg.as_list().front();
else
arg = &rawArg;
value_type value;
switch (arg.type()) {
switch (arg->type()) {
case torrent::Object::TYPE_STRING:
string_to_value_unit(arg.as_string().c_str(), &value, m_base, m_unit);
string_to_value_unit(arg->as_string().c_str(), &value, m_base, m_unit);
// Check if we hit the end of the input.
@@ -188,7 +195,7 @@ VariableValueSlot::set(const torrent::Object& arg) {
break;
case torrent::Object::TYPE_VALUE:
m_slotSet(arg.as_value());
m_slotSet(arg->as_value());
break;
default:
+12
View File
@@ -236,4 +236,16 @@ VariableMap::process_file(key_type path) {
return true;
}
const VariableMap::mapped_type&
VariableMap::call_command_get(key_type key, const mapped_type& arg) {
return get(key);
}
const VariableMap::mapped_type&
VariableMap::call_command_set(key_type key, const mapped_type& arg) {
set(key, arg);
return Variable::m_emptyObject;
}
}
+5
View File
@@ -117,6 +117,11 @@ public:
void process_stream(std::istream* str);
bool process_file(key_type path);
// The new API, which is atm just a wrapper over the old and
// requires seperate calls to get and set. These will be merged.
const mapped_type& call_command_get(key_type key, const mapped_type& arg);
const mapped_type& call_command_set(key_type key, const mapped_type& arg);
private:
VariableMap(const VariableMap&);
void operator = (const VariableMap&);