Rename PBD::get_directory_contents to PBD::get_paths
authorTim Mayberry <mojofunk@gmail.com>
Sun, 22 Jun 2014 07:22:37 +0000 (17:22 +1000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 25 Jun 2014 16:40:10 +0000 (12:40 -0400)
shorter name and change order of parameters to match other functions

libs/pbd/file_utils.cc
libs/pbd/pbd/file_utils.h

index 08a99b3355ede9394d7f9662c64f78961b7c4be7..fcc2301ebba28a6fb2d7279aeaaa99320b922faa 100644 (file)
@@ -134,10 +134,10 @@ run_functor_for_paths (vector<string>& result,
 }
 
 void
-get_directory_contents (const std::string& directory_path,
-                       vector<string>& result,
-                       bool files_only,
-                       bool recurse)
+get_paths (vector<string>& result,
+           const std::string& directory_path,
+           bool files_only,
+           bool recurse)
 {
        // perhaps we don't need this check assuming an exception is thrown
        // as it would save checking that the path is a directory twice when
@@ -159,7 +159,7 @@ get_directory_contents (const std::string& directory_path,
                                DEBUG_TRACE (DEBUG::FileUtils,
                                                string_compose("Descending into directory:  %1\n",
                                                fullpath));
-                               get_directory_contents (fullpath, result, files_only, recurse);
+                               get_paths (result, fullpath, files_only, recurse);
                        }
 
                        i++;
@@ -179,7 +179,7 @@ get_directory_contents (const std::string& directory_path,
 void
 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
@@ -453,7 +453,7 @@ remove_directory_internal (const string& dir, size_t* size, vector<string>* path
        struct stat statbuf;
        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();
             i != tmp_paths.end(); ++i) {
index ab42fd23570b44f09e0f9859cee3f92c72c3217d..04ce654f3419f05f10b0e91f8e38439a3f883847 100644 (file)
@@ -31,7 +31,8 @@
 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
  *
  * @param path An absolute path to a directory in the filename encoding
@@ -41,10 +42,10 @@ namespace PBD {
  * @param recurse Recurse into child directories
  */
 LIBPBD_API void
-get_directory_contents (const std::string& path,
-                        std::vector<std::string>& result,
-                       bool files_only = true,
-                       bool recurse = false);
+get_paths (std::vector<std::string>& result,
+           const std::string& directory_path,
+           bool files_only = true,
+           bool recurse = false);
 
 /**
  * Get a list of files in a directory.