Show
Ignore:
Timestamp:
12/23/07 14:12:23 (4 years ago)
Author:
rakshasa
Message:

* Refactoring utils::Directory.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/rtorrent/src/core/manager.cc

    r1013 r1022  
    5757 
    5858#include "rpc/parse_commands.h" 
     59#include "utils/directory.h" 
    5960 
    6061#include "globals.h" 
     
    418419} 
    419420 
     421utils::Directory 
     422path_expand_transform(std::string path, const utils::directory_entry& entry) { 
     423  return path + entry.d_name; 
     424} 
     425 
    420426// Move this somewhere better. 
    421427void 
     
    455461      // starts with the same. 
    456462      itr->update(r.pattern()[0] != '.'); 
    457       itr->erase(std::remove_if(itr->begin(), itr->end(), std::not1(r)), itr->end()); 
    458  
    459       std::transform(itr->begin(), itr->end(), std::back_inserter(nextCache), std::bind1st(std::plus<std::string>(), itr->get_path() + "/")); 
     463      itr->erase(std::remove_if(itr->begin(), itr->end(), rak::on(rak::mem_ref(&utils::directory_entry::d_name), std::not1(r))), itr->end()); 
     464 
     465      std::transform(itr->begin(), itr->end(), std::back_inserter(nextCache), rak::bind1st(std::ptr_fun(&path_expand_transform), itr->get_path() + "/")); 
    460466    } 
    461467