13
0

Add function PBD::find_paths_matching_filter

This commit is contained in:
Tim Mayberry 2014-06-22 13:11:27 +10:00 committed by Paul Davis
parent 54c0a0144c
commit 24599c552d
2 changed files with 24 additions and 0 deletions

View File

@ -289,6 +289,17 @@ find_files_matching_regex (vector<string>& result,
regfree (&compiled_pattern);
}
void
find_paths_matching_filter (vector<string>& result,
const Searchpath& paths,
bool (*filter)(const string &, void *),
void *arg,
bool match_fullpath, bool return_fullpath,
bool recurse)
{
run_functor_for_paths (result, paths, filter, arg, false, match_fullpath, return_fullpath, recurse);
}
void
find_files_matching_filter (vector<string>& result,
const Searchpath& paths,

View File

@ -109,6 +109,19 @@ find_files_matching_regex (std::vector<std::string>& results,
const Searchpath& dirpath,
const std::string& regexp);
/**
* @return paths in a Searchpath that match a supplied filter(functor)
* @note results include files and directories
*/
LIBPBD_API void
find_paths_matching_filter (std::vector<std::string>&,
const Searchpath& paths,
bool (*filter)(const std::string &, void *),
void *arg,
bool match_fullpath,
bool return_fullpath,
bool recurse = false);
/**
* @return files in a Searchpath that match a supplied filter(functor)
*/