Changeset 1022 for trunk/rtorrent/src/core/download_store.cc
- Timestamp:
- 12/23/07 14:12:23 (4 years ago)
- Files:
-
- 1 modified
-
trunk/rtorrent/src/core/download_store.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/rtorrent/src/core/download_store.cc
r938 r1022 51 51 #include <torrent/resume.h> 52 52 #include <torrent/object_stream.h> 53 54 #include "utils/directory.h" 53 55 54 56 #include "download.h" … … 145 147 } 146 148 149 // This also needs to check that it isn't a directory. 150 bool 151 not_correct_format(const utils::directory_entry& entry) { 152 return !DownloadStore::is_correct_format(entry.d_name); 153 } 154 147 155 utils::Directory 148 156 DownloadStore::get_formated_entries() { … … 150 158 return utils::Directory(); 151 159 152 utils::Directory d(m_path); 160 utils::Directory d; 161 d.set_path(m_path); 153 162 154 163 if (!d.update()) 155 164 throw torrent::storage_error("core::DownloadStore::update() could not open directory \"" + m_path + "\""); 156 165 157 d.erase(std::remove_if(d.begin(), d.end(), std:: not1(std::ptr_fun(&DownloadStore::is_correct_format))), d.end());166 d.erase(std::remove_if(d.begin(), d.end(), std::ptr_fun(¬_correct_format)), d.end()); 158 167 159 168 return d; … … 161 170 162 171 bool 163 DownloadStore::is_correct_format( std::stringf) {172 DownloadStore::is_correct_format(const std::string& f) { 164 173 if (f.size() != 48 || f.substr(40) != ".torrent") 165 174 return false;
