#else
Glib::PatternSpec dll_extension_pattern("*backend.dll");
#endif
-
- find_matching_files_in_search_path (backend_search_path (),
- so_extension_pattern, backend_modules);
- find_matching_files_in_search_path (backend_search_path (),
- dylib_extension_pattern, backend_modules);
+ find_files_matching_pattern (backend_modules, backend_search_path (),
+ so_extension_pattern);
+
+ find_files_matching_pattern (backend_modules, backend_search_path (),
+ dylib_extension_pattern);
- find_matching_files_in_search_path (backend_search_path (),
- dll_extension_pattern, backend_modules);
+ find_files_matching_pattern (backend_modules, backend_search_path (),
+ dll_extension_pattern);
DEBUG_TRACE (DEBUG::AudioEngine, string_compose ("looking for backends in %1\n", backend_search_path().to_string()));
Glib::PatternSpec so_extension_pattern("*.so");
Glib::PatternSpec dylib_extension_pattern("*.dylib");
- find_matching_files_in_search_path (control_protocol_search_path (),
- dll_extension_pattern, cp_modules);
+ find_files_matching_pattern (cp_modules, control_protocol_search_path (),
+ dll_extension_pattern);
- find_matching_files_in_search_path (control_protocol_search_path (),
- so_extension_pattern, cp_modules);
+ find_files_matching_pattern (cp_modules, control_protocol_search_path (),
+ so_extension_pattern);
- find_matching_files_in_search_path (control_protocol_search_path (),
- dylib_extension_pattern, cp_modules);
+ find_files_matching_pattern (cp_modules, control_protocol_search_path (),
+ dylib_extension_pattern);
DEBUG_TRACE (DEBUG::ControlProtocols,
string_compose (_("looking for control protocols in %1\n"), control_protocol_search_path().to_string()));
{
vector<std::string> found;
- Glib::PatternSpec pattern_spec (pattern);
- find_matching_files_in_search_path (search_path, pattern_spec, found);
+ find_files_matching_pattern (found, search_path, pattern);
return found;
}
Searchpath spath = ardour_config_search_path();
if (getenv ("ARDOUR_SAE")) {
- Glib::PatternSpec pattern("*SAE-*.bindings");
- find_matching_files_in_search_path (spath, pattern, found);
+ find_files_matching_pattern (found, spath, "*SAE-*.bindings");
} else {
- Glib::PatternSpec pattern("*.bindings");
- find_matching_files_in_search_path (spath, pattern, found);
+ find_files_matching_pattern (found, spath, "*.bindings");
}
if (found.empty()) {
assert (Glib::file_test (path_to_patches, Glib::FILE_TEST_IS_DIR));
- Glib::PatternSpec pattern(string("*.midnam"));
vector<std::string> result;
- find_matching_files_in_directory (path_to_patches, pattern, result);
+ find_files_matching_pattern (result, path_to_patches, "*.midnam");
info << "Loading " << result.size() << " MIDI patches from " << path_to_patches << endmsg;
_all_models.clear();
Searchpath search_path = midi_patch_search_path ();
- Glib::PatternSpec pattern (string("*.midnam"));
vector<std::string> result;
- find_matching_files_in_search_path (search_path, pattern, result);
+ find_files_matching_pattern (result, search_path, "*.midnam");
info << "Loading " << result.size() << " MIDI patches from " << search_path.to_string() << endmsg;
DEBUG_TRACE (DEBUG::PluginManager, string_compose ("LADSPA: search along: [%1]\n", ladspa_search_path().to_string()));
- Glib::PatternSpec so_extension_pattern("*.so");
- Glib::PatternSpec dylib_extension_pattern("*.dylib");
- Glib::PatternSpec dll_extension_pattern("*.dll");
-
- find_matching_files_in_search_path (ladspa_search_path (),
- so_extension_pattern, ladspa_modules);
-
- find_matching_files_in_search_path (ladspa_search_path (),
- dylib_extension_pattern, ladspa_modules);
-
- find_matching_files_in_search_path (ladspa_search_path (),
- dll_extension_pattern, ladspa_modules);
+ find_files_matching_pattern (ladspa_modules, ladspa_search_path (), "*.so");
+ find_files_matching_pattern (ladspa_modules, ladspa_search_path (), "*.dylib");
+ find_files_matching_pattern (ladspa_modules, ladspa_search_path (), "*.dll");
for (vector<std::string>::iterator i = ladspa_modules.begin(); i != ladspa_modules.end(); ++i) {
ARDOUR::PluginScanMessage(_("LADSPA"), *i, false);
get_state_files_in_directory (const std::string & directory_path,
vector<std::string> & result)
{
- Glib::PatternSpec state_file_pattern('*' + string(statefile_suffix));
-
- find_matching_files_in_directory (directory_path, state_file_pattern,
- result);
+ find_files_matching_pattern (result, directory_path,
+ '*' + string(statefile_suffix));
}
vector<string>
vector<std::string>& server_paths)
{
for (vector<string>::const_iterator i = server_names.begin(); i != server_names.end(); ++i) {
- Glib::PatternSpec ps (*i);
- find_matching_files_in_directories (server_dir_paths, ps, server_paths);
+ find_files_matching_pattern (server_paths, server_dir_paths, *i);
}
return !server_paths.empty();
}
Glib::PatternSpec pattern(string("*.midnam"));
vector<std::string> result;
- PBD::find_matching_files_in_directory (prefix, pattern, result);
+ PBD::find_files_matching_pattern (result, prefix, pattern);
cout << "Loading " << result.size() << " MIDI patches from " << prefix << endl;
find_files_matching_pattern (result, paths, tmp);
}
-void
-find_matching_files_in_directory (const std::string& directory,
- const Glib::PatternSpec& pattern,
- vector<std::string>& result)
-{
- find_files_matching_pattern (result, directory, pattern);
-}
-
-void
-find_matching_files_in_directories (const vector<std::string>& paths,
- const Glib::PatternSpec& pattern,
- vector<std::string>& result)
-{
- find_files_matching_pattern (result, paths, pattern);
-}
-
-void
-find_matching_files_in_search_path (const Searchpath& search_path,
- const Glib::PatternSpec& pattern,
- vector<std::string>& result)
-{
- find_files_matching_pattern (result, search_path, pattern);
-}
-
bool
find_file_in_search_path(const Searchpath& search_path,
const string& filename,
std::string& result)
{
vector<std::string> tmp;
- Glib::PatternSpec tmp_pattern(filename);
- find_matching_files_in_search_path (search_path, tmp_pattern, tmp);
+ find_files_matching_pattern (tmp, search_path, filename);
if (tmp.size() == 0)
{
const Searchpath& paths,
const std::string& pattern);
-/**
- * Takes a directory path and returns all the files in the directory
- * matching a particular pattern.
- *
- * @param directory A directory path
- * @param pattern A Glib::PatternSpec used to match the files.
- * @param result A vector in which to place the resulting matches.
- */
-LIBPBD_API void
-find_matching_files_in_directory (const std::string& directory,
- const Glib::PatternSpec& pattern,
- std::vector<std::string>& result);
-
-/**
- * Takes a number of directory paths and returns all the files matching
- * a particular pattern.
- *
- * @param paths A vector containing the Absolute paths
- * @param pattern A Glib::PatternSpec used to match the files
- * @param result A vector in which to place the resulting matches.
- */
-LIBPBD_API void
-find_matching_files_in_directories (const std::vector<std::string>& directory_paths,
- const Glib::PatternSpec& pattern,
- std::vector<std::string>& result);
-
-/**
- * Takes a Searchpath and puts a list of all the files in the search path
- * that match pattern into the result vector.
- *
- * @param search_path A Searchpath
- * @param pattern A Glib::PatternSpec used to match the files
- * @param result A vector in which to place the resulting matches.
- */
-LIBPBD_API void
-find_matching_files_in_search_path (const Searchpath& search_path,
- const Glib::PatternSpec& pattern,
- std::vector<std::string>& result);
-
/**
* Takes a search path and a file name and place the full path
* to that file in result if it is found within the search path.