mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-07 18:52:30 +00:00
* Working on new infrastructure for parseing commands. It now passes a
list instead of a string when calling a multi-parameter command, which handles escaped spaces, commas and quotes correctly. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@877 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "parse.h"
|
||||
#include "variable_generic.h"
|
||||
|
||||
namespace utils {
|
||||
@@ -249,6 +250,9 @@ VariableStringSlot::set(const torrent::Object& arg) {
|
||||
case torrent::Object::TYPE_NONE:
|
||||
m_slotSet(std::string());
|
||||
break;
|
||||
case torrent::Object::TYPE_LIST:
|
||||
m_slotSet(convert_list_to_string(arg));
|
||||
break;
|
||||
default:
|
||||
throw torrent::input_error("Not a string.");
|
||||
}
|
||||
@@ -280,4 +284,30 @@ VariableDownloadStringSlot::set_d(core::Download* download, const torrent::Objec
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
VariableListSlot::set(const torrent::Object& arg) {
|
||||
switch (arg.type()) {
|
||||
// case torrent::Object::TYPE_STRING:
|
||||
// break;
|
||||
case torrent::Object::TYPE_LIST:
|
||||
m_slotSet(arg.as_list());
|
||||
break;
|
||||
default:
|
||||
throw torrent::input_error("Not a list.");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
VariableDownloadListSlot::set_d(core::Download* download, const torrent::Object& arg) {
|
||||
switch (arg.type()) {
|
||||
// case torrent::Object::TYPE_STRING:
|
||||
// break;
|
||||
case torrent::Object::TYPE_LIST:
|
||||
m_slotSet(download, arg.as_list());
|
||||
break;
|
||||
default:
|
||||
throw torrent::input_error("Not a list.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user