mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 23:22:31 +00:00
* Added string, value and bool types to 'system.method.insert' for
storing variables. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1076 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -49,6 +49,10 @@
|
||||
#include "command.h"
|
||||
#include "command_map.h"
|
||||
|
||||
// For XMLRPC stuff, clean up.
|
||||
#include "xmlrpc.h"
|
||||
#include "parse_commands.h"
|
||||
|
||||
namespace rpc {
|
||||
|
||||
CommandMap::~CommandMap() {
|
||||
@@ -73,6 +77,9 @@ CommandMap::insert(key_type key, Command* variable, int flags, const char* parm,
|
||||
if (itr != base_type::end())
|
||||
throw torrent::internal_error("CommandMap::insert(...) tried to insert an already existing key.");
|
||||
|
||||
if (rpc::xmlrpc.is_valid())
|
||||
rpc::xmlrpc.insert_command(key, parm, doc);
|
||||
|
||||
return base_type::insert(itr, value_type(key, command_map_data_type(variable, flags, parm, doc)));
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,8 @@ public:
|
||||
bool has(const char* key) const { return base_type::find(key) != base_type::end(); }
|
||||
bool has(const std::string& key) const { return has(key.c_str()); }
|
||||
|
||||
bool is_modifiable(const_iterator itr) { return itr != end() && (itr->second.m_flags & flag_modifiable); }
|
||||
|
||||
iterator insert(key_type key, Command* variable, int flags, const char* parm, const char* doc);
|
||||
|
||||
// Make this a wrapper call to insert without extra fluff.
|
||||
|
||||
@@ -123,7 +123,7 @@ CommandVariable::set_string(Command* rawCommand, cleaned_type target, const torr
|
||||
|
||||
switch (arg.type()) {
|
||||
case torrent::Object::TYPE_NONE:
|
||||
variable->m_variable = std::string("");
|
||||
variable->m_variable = std::string();
|
||||
break;
|
||||
|
||||
// case torrent::Object::TYPE_VALUE:
|
||||
|
||||
Reference in New Issue
Block a user