recursive regexp file search.
authorRobin Gareus <robin@gareus.org>
Tue, 3 Mar 2015 15:41:44 +0000 (16:41 +0100)
committerRobin Gareus <robin@gareus.org>
Tue, 3 Mar 2015 18:54:27 +0000 (19:54 +0100)
libs/pbd/file_utils.cc
libs/pbd/pbd/file_utils.h

index 9523fdd6bdbd5bd7d6379146d574daa7fe556aef..a15cd04cd4f23f58f4277a3f878b4e7982a5bbf9 100644 (file)
@@ -225,7 +225,8 @@ regexp_filter (const string& str, void *arg)
 void
 find_files_matching_regex (vector<string>& result,
                            const Searchpath& paths,
-                           const std::string& regexp)
+                           const std::string& regexp,
+                           bool recurse)
 {
        int err;
        char msg[256];
@@ -250,7 +251,7 @@ find_files_matching_regex (vector<string>& result,
 
        find_files_matching_filter (result, paths,
                                    regexp_filter, &compiled_pattern,
-                                   true, true, false);
+                                   true, true, recurse);
 
        regfree (&compiled_pattern);
 }
index 7a9cb68318d224d6847f7be87ab4e39ffb24aec5..bd22f341d874414b9f42848eb9500dd5c771a5aa 100644 (file)
@@ -117,7 +117,8 @@ find_file (const Searchpath& search_path,
 LIBPBD_API void
 find_files_matching_regex (std::vector<std::string>& results,
                            const Searchpath& paths,
-                           const std::string& regexp);
+                           const std::string& regexp,
+                           bool recurse = false);
 
 /**
  * Find paths in a Searchpath that match a supplied filter(functor)