13
0

Rename PathScanner::run_scan_internal to PathScanner::find_files_matching_filter

This commit is contained in:
Tim Mayberry 2014-06-17 11:32:51 +10:00
parent 3066bd48da
commit cde8776e80
2 changed files with 26 additions and 31 deletions

View File

@ -78,10 +78,10 @@ PathScanner::find_files_matching_regex (vector<string>& result,
return;
}
run_scan_internal (result, dirpath,
regexp_filter, &compiled_pattern,
match_fullpath, return_fullpath,
limit, recurse);
find_files_matching_filter (result, dirpath,
regexp_filter, &compiled_pattern,
match_fullpath, return_fullpath,
limit, recurse);
regfree (&compiled_pattern);
}
@ -105,13 +105,13 @@ PathScanner::operator() (const string &dirpath, const string &regexp,
}
void
PathScanner::run_scan_internal (vector<string>& result,
const string &dirpath,
bool (*filter)(const string &, void *),
void *arg,
bool match_fullpath, bool return_fullpath,
long limit,
bool recurse)
PathScanner::find_files_matching_filter (vector<string>& result,
const string &dirpath,
bool (*filter)(const string &, void *),
void *arg,
bool match_fullpath, bool return_fullpath,
long limit,
bool recurse)
{
DIR *dir;
struct dirent *finfo;
@ -149,7 +149,7 @@ PathScanner::run_scan_internal (vector<string>& result,
}
if (statbuf.st_mode & S_IFDIR && recurse) {
run_scan_internal (result, fullpath, filter, arg, match_fullpath, return_fullpath, limit, recurse);
find_files_matching_filter (result, fullpath, filter, arg, match_fullpath, return_fullpath, limit, recurse);
} else {
if (match_fullpath) {
@ -205,14 +205,9 @@ PathScanner::find_first (const string &dirpath,
bool return_fullpath)
{
vector<string> res;
string ret;
run_scan_internal (res,
dirpath,
filter,
0,
match_fullpath,
return_fullpath, 1);
find_files_matching_filter (res, dirpath, filter, 0,
match_fullpath, return_fullpath, 1);
if (res.size() == 0) {
return string();

View File

@ -42,10 +42,10 @@ class LIBPBD_API PathScanner
long limit = -1,
bool recurse = false) {
std::vector<std::string> result;
run_scan_internal (result, dirpath,
filter, arg,
match_fullpath, return_fullpath,
limit, recurse);
find_files_matching_filter (result, dirpath,
filter, arg,
match_fullpath, return_fullpath,
limit, recurse);
return result;
}
@ -77,14 +77,14 @@ class LIBPBD_API PathScanner
long limit,
bool recurse = false);
void run_scan_internal (std::vector<std::string>&,
const std::string &dirpath,
bool (*filter)(const std::string &, void *),
void *arg,
bool match_fullpath,
bool return_fullpath,
long limit,
bool recurse = false);
void find_files_matching_filter (std::vector<std::string>&,
const std::string &dirpath,
bool (*filter)(const std::string &, void *),
void *arg,
bool match_fullpath,
bool return_fullpath,
long limit,
bool recurse = false);
};
#endif // __libmisc_pathscanner_h__