From 3b1a98f0ecd8de35b29d9429849c3caf7afac921 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sun, 22 Jun 2014 19:58:19 +1000 Subject: Change PBD::get_files and PBD::get_paths to take a Searchpath instead of directory path Both these functions use the internal function run_functor_for_paths which takes a Searchpath so this avoids a temporary variable in cases where a Searchpath is passed directly. The usage is the same as the compiler will generate a temporary Searchpath from a string(directory path) if necessary. --- libs/pbd/file_utils.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libs/pbd/file_utils.cc') diff --git a/libs/pbd/file_utils.cc b/libs/pbd/file_utils.cc index 8338058707..f4efea00f3 100644 --- a/libs/pbd/file_utils.cc +++ b/libs/pbd/file_utils.cc @@ -141,18 +141,18 @@ bool accept_all_files (string const &, void *) void get_paths (vector& result, - const std::string& directory_path, + const Searchpath& paths, bool files_only, bool recurse) { - run_functor_for_paths (result, directory_path, accept_all_files, 0, + run_functor_for_paths (result, paths, accept_all_files, 0, files_only, true, true, recurse); } void -get_files (vector& result, const std::string& directory_path) +get_files (vector& result, const Searchpath& paths) { - return get_paths (result, directory_path, true, false); + return get_paths (result, paths, true, false); } static -- cgit v1.2.3