13
0

Remove unused methods in PathScanner

Now that these methods are only a few lines it doesn't make much sense
to keep them seeing as they are unused. There are also functions with
near identical functionality in pbd/file_utils.h
This commit is contained in:
Tim Mayberry 2014-06-17 11:39:04 +10:00
parent cde8776e80
commit b457c938cd
2 changed files with 1 additions and 49 deletions

View File

@ -178,40 +178,3 @@ PathScanner::find_files_matching_filter (vector<string>& result,
free (pathcopy);
return;
}
string
PathScanner::find_first (const string &dirpath,
const string &regexp,
bool match_fullpath,
bool return_fullpath)
{
vector<string> res;
find_files_matching_regex (res, dirpath, regexp,
match_fullpath, return_fullpath, 1);
if (res.size() == 0) {
return string();
}
return res.front();
}
string
PathScanner::find_first (const string &dirpath,
bool (*filter)(const string &, void *),
void * /*arg*/,
bool match_fullpath,
bool return_fullpath)
{
vector<string> res;
find_files_matching_filter (res, dirpath, filter, 0,
match_fullpath, return_fullpath, 1);
if (res.size() == 0) {
return string();
}
return res.front();
}

View File

@ -55,18 +55,7 @@ class LIBPBD_API PathScanner
bool return_fullpath = true,
long limit = -1,
bool recurse = false);
std::string find_first (const std::string &dirpath,
const std::string &regexp,
bool match_fullpath = true,
bool return_fullpath = true);
std::string find_first (const std::string &dirpath,
bool (*filter)(const std::string &, void *),
void *arg,
bool match_fullpath = true,
bool return_fullpath = true);
private:
void find_files_matching_regex (std::vector<std::string>& results,