mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-11 08:39:21 +00:00
* Refactoring utils::Directory.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1022 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+8
-2
@@ -56,6 +56,7 @@
|
||||
#include <torrent/tracker_list.h>
|
||||
|
||||
#include "rpc/parse_commands.h"
|
||||
#include "utils/directory.h"
|
||||
|
||||
#include "globals.h"
|
||||
#include "curl_get.h"
|
||||
@@ -417,6 +418,11 @@ Manager::try_create_download(const std::string& uri, int flags, const command_li
|
||||
f->commit();
|
||||
}
|
||||
|
||||
utils::Directory
|
||||
path_expand_transform(std::string path, const utils::directory_entry& entry) {
|
||||
return path + entry.d_name;
|
||||
}
|
||||
|
||||
// Move this somewhere better.
|
||||
void
|
||||
path_expand(std::vector<std::string>* paths, const std::string& pattern) {
|
||||
@@ -454,9 +460,9 @@ path_expand(std::vector<std::string>* paths, const std::string& pattern) {
|
||||
// Only include filenames starting with '.' if the pattern
|
||||
// starts with the same.
|
||||
itr->update(r.pattern()[0] != '.');
|
||||
itr->erase(std::remove_if(itr->begin(), itr->end(), std::not1(r)), itr->end());
|
||||
itr->erase(std::remove_if(itr->begin(), itr->end(), rak::on(rak::mem_ref(&utils::directory_entry::d_name), std::not1(r))), itr->end());
|
||||
|
||||
std::transform(itr->begin(), itr->end(), std::back_inserter(nextCache), std::bind1st(std::plus<std::string>(), itr->get_path() + "/"));
|
||||
std::transform(itr->begin(), itr->end(), std::back_inserter(nextCache), rak::bind1st(std::ptr_fun(&path_expand_transform), itr->get_path() + "/"));
|
||||
}
|
||||
|
||||
currentCache.clear();
|
||||
|
||||
Reference in New Issue
Block a user