* 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:
rakshasa
2007-03-25 18:03:07 +00:00
parent 0ab5bae22e
commit ee6eae6c84
10 changed files with 506 additions and 248 deletions
+30
View File
@@ -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.");
}
}
}