Rename PBD::get_directory_contents to PBD::get_paths

shorter name and change order of parameters to match other functions
This commit is contained in:
Tim Mayberry 2014-06-22 17:22:37 +10:00 committed by Paul Davis
parent 26ec4038af
commit 84d190b7cc
2 changed files with 13 additions and 12 deletions

View file

@ -134,8 +134,8 @@ run_functor_for_paths (vector<string>& result,
} }
void void
get_directory_contents (const std::string& directory_path, get_paths (vector<string>& result,
vector<string>& result, const std::string& directory_path,
bool files_only, bool files_only,
bool recurse) bool recurse)
{ {
@ -159,7 +159,7 @@ get_directory_contents (const std::string& directory_path,
DEBUG_TRACE (DEBUG::FileUtils, DEBUG_TRACE (DEBUG::FileUtils,
string_compose("Descending into directory: %1\n", string_compose("Descending into directory: %1\n",
fullpath)); fullpath));
get_directory_contents (fullpath, result, files_only, recurse); get_paths (result, fullpath, files_only, recurse);
} }
i++; i++;
@ -179,7 +179,7 @@ get_directory_contents (const std::string& directory_path,
void void
get_files_in_directory (const std::string& directory_path, vector<string>& result) get_files_in_directory (const std::string& directory_path, vector<string>& result)
{ {
return get_directory_contents (directory_path, result, true, false); return get_paths (result, directory_path, true, false);
} }
static static
@ -453,7 +453,7 @@ remove_directory_internal (const string& dir, size_t* size, vector<string>* path
struct stat statbuf; struct stat statbuf;
int ret = 0; int ret = 0;
get_directory_contents (dir, tmp_paths, just_remove_files, true); get_paths (tmp_paths, dir, just_remove_files, true);
for (vector<string>::const_iterator i = tmp_paths.begin(); for (vector<string>::const_iterator i = tmp_paths.begin();
i != tmp_paths.end(); ++i) { i != tmp_paths.end(); ++i) {

View file

@ -31,7 +31,8 @@
namespace PBD { namespace PBD {
/** /**
* Get a contents of directory. * Get a list of path entries in a directory or within a directory tree
* if recursing.
* @note paths in result will be absolute * @note paths in result will be absolute
* *
* @param path An absolute path to a directory in the filename encoding * @param path An absolute path to a directory in the filename encoding
@ -41,8 +42,8 @@ namespace PBD {
* @param recurse Recurse into child directories * @param recurse Recurse into child directories
*/ */
LIBPBD_API void LIBPBD_API void
get_directory_contents (const std::string& path, get_paths (std::vector<std::string>& result,
std::vector<std::string>& result, const std::string& directory_path,
bool files_only = true, bool files_only = true,
bool recurse = false); bool recurse = false);