mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 13:12:32 +00:00
* 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:
+10
-4
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user