* Fixed more redirected commands.

* Cleaned up the Command stack implementation.

* Added framework for object_storage class that will hold variables and user-defined command lists.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1162 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2010-04-11 14:19:27 +00:00
parent 856228da3d
commit 74bae32243
15 changed files with 276 additions and 140 deletions
+10 -4
View File
@@ -77,18 +77,24 @@ get_target_cast<torrent::File*>(target_type target, int type) {
}
inline torrent::Object*
Command::push_stack(const torrent::Object::list_type& args, stack_type* stack) {
Command::push_stack(const torrent::Object* first_arg, const torrent::Object* last_arg, stack_type* stack) {
unsigned int idx = 0;
for (torrent::Object::list_const_iterator itr = args.begin(), last = args.end();
itr != last && idx < Command::max_arguments; itr++, idx++) {
new (&(*stack)[idx]) torrent::Object(*itr);
while (first_arg != last_arg && idx < Command::max_arguments) {
new (&(*stack)[idx]) torrent::Object(*first_arg++);
(*stack)[idx].swap(*Command::argument(idx));
idx++;
}
return stack->begin() + idx;
}
inline torrent::Object*
Command::push_stack(const torrent::Object::list_type& args, stack_type* stack) {
return push_stack(args.data(), args.data() + args.size(), stack);
}
inline void
Command::pop_stack(stack_type* stack, torrent::Object* last_stack) {
while (last_stack-- != stack->begin()) {