* Return torrent::Object instead of reference from

utils::VariableMap::call_command(...).

* More cleanup of the command calls.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@895 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-04-28 02:37:08 +00:00
parent c5beb24d6c
commit 43fd2c92ec
19 changed files with 353 additions and 192 deletions
+20 -4
View File
@@ -40,7 +40,7 @@
namespace utils {
const torrent::Object&
const torrent::Object
CommandSlot::call_list(Variable* rawVariable, const torrent::Object& rawArgs) {
CommandSlot* command = static_cast<CommandSlot*>(rawVariable);
@@ -74,13 +74,29 @@ CommandSlot::call_list(Variable* rawVariable, const torrent::Object& rawArgs) {
// case torrent::Object::TYPE_STRING:
// break;
case torrent::Object::TYPE_LIST:
command->m_slot(rawArgs);
break;
return command->m_slot(rawArgs);
default:
throw torrent::input_error("Not a list.");
}
}
return m_emptyObject;
const torrent::Object
CommandSlot::call_string(Variable* rawVariable, const torrent::Object& rawArgs) {
CommandSlot* command = static_cast<CommandSlot*>(rawVariable);
const torrent::Object& arg = to_single_argument(rawArgs);
switch (arg.type()) {
// case torrent::Object::TYPE_VALUE:
// break;
case torrent::Object::TYPE_STRING:
return command->m_slot(arg);
break;
default:
throw torrent::input_error("Not a string.");
}
}
// const torrent::Object&