Rename SearchPath class Searchpath

Windows headers define SearchPath which means we have to undefine it
where necessary. This is a pain and can be tricksy, so I feel renaming
the class slightly is the easiest solution.
This commit is contained in:
Tim Mayberry 2013-08-15 20:04:08 +10:00
parent e6c7ecf0e3
commit 8ddd12a60d
46 changed files with 125 additions and 189 deletions

View file

@ -40,10 +40,6 @@
#include "i18n.h"
#ifdef SearchPath
#undef SearchPath
#endif
using namespace Gtk;
using namespace Gdk;
using namespace std;
@ -564,7 +560,7 @@ About::About ()
std::string splash_file;
SearchPath spath(ardour_data_search_path());
Searchpath spath(ardour_data_search_path());
if (find_file_in_search_path (spath, "splash.png", splash_file)) {
set_logo (Gdk::Pixbuf::create_from_file (splash_file));

View file

@ -28,10 +28,6 @@
#include "i18n.h"
#ifdef SearchPath
#undef SearchPath
#endif
using namespace std;
using namespace Gtk;
using namespace PBD;

View file

@ -26,10 +26,6 @@
#include "missing_file_dialog.h"
#include "i18n.h"
#ifdef SearchPath
#undef SearchPath
#endif
using namespace Gtk;
using namespace std;
using namespace ARDOUR;

View file

@ -35,10 +35,6 @@
#include "i18n.h"
#ifdef SearchPath
#undef SearchPath
#endif
using namespace ARDOUR;
using namespace Gtk;
using namespace PBD;

View file

@ -36,10 +36,6 @@
#include "i18n.h"
#ifdef SearchPath
#undef SearchPath
#endif
using namespace std;
using namespace Gtk;
using namespace Glib;

View file

@ -32,10 +32,6 @@
#include "i18n.h"
#ifdef SearchPath
#undef SearchPath
#endif
using namespace PBD;
using namespace VideoUtils;
@ -55,7 +51,7 @@ TranscodeFfmpeg::TranscodeFfmpeg (std::string f)
#endif
std::string ff_file_path;
if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("ffmpeg_harvid"), ff_file_path)) { ffmpeg_exe = ff_file_path; }
if (find_file_in_search_path (Searchpath(Glib::getenv("PATH")), X_("ffmpeg_harvid"), ff_file_path)) { ffmpeg_exe = ff_file_path; }
else if (Glib::file_test(X_("C:\\Program Files\\harvid\\ffmpeg.exe"), Glib::FILE_TEST_EXISTS)) {
ffmpeg_exe = X_("C:\\Program Files\\ffmpeg\\ffmpeg.exe");
}
@ -63,7 +59,7 @@ TranscodeFfmpeg::TranscodeFfmpeg (std::string f)
ffmpeg_exe = X_("C:\\Program Files\\ffmpeg\\ffmpeg.exe");
}
if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("ffprobe_harvid"), ff_file_path)) { ffprobe_exe = ff_file_path; }
if (find_file_in_search_path (Searchpath(Glib::getenv("PATH")), X_("ffprobe_harvid"), ff_file_path)) { ffprobe_exe = ff_file_path; }
else if (Glib::file_test(X_("C:\\Program Files\\harvid\\ffprobe.exe"), Glib::FILE_TEST_EXISTS)) {
ffprobe_exe = X_("C:\\Program Files\\ffmpeg\\ffprobe.exe");
}

View file

@ -581,7 +581,7 @@ get_xpm (std::string name)
{
if (!xpm_map[name]) {
SearchPath spath(ARDOUR::ardour_data_search_path());
Searchpath spath(ARDOUR::ardour_data_search_path());
spath.add_subdirectory_to_paths("pixmaps");
@ -607,7 +607,7 @@ get_icon_path (const char* cname)
string name = cname;
name += X_(".png");
SearchPath spath(ARDOUR::ardour_data_search_path());
Searchpath spath(ARDOUR::ardour_data_search_path());
spath.add_subdirectory_to_paths("icons");

View file

@ -37,10 +37,6 @@
#include "utils_videotl.h"
#include "i18n.h"
#ifdef SearchPath
#undef SearchPath
#endif
using namespace Gtk;
using namespace std;
using namespace PBD;
@ -88,7 +84,7 @@ VideoServerDialog::VideoServerDialog (Session* s)
listenaddr_combo.set_active(0);
std::string icsd_file_path;
if (find_file_in_search_path (PBD::SearchPath(Glib::getenv("PATH")), X_("harvid"), icsd_file_path)) {
if (find_file_in_search_path (PBD::Searchpath(Glib::getenv("PATH")), X_("harvid"), icsd_file_path)) {
path_entry.set_text(icsd_file_path);
}
else if (Glib::file_test(X_("C:\\Program Files\\harvid\\harvid.exe"), Glib::FILE_TEST_EXISTS)) {

View file

@ -719,7 +719,7 @@ VideoTimeLine::find_xjadeo () {
std::string xjadeo_file_path;
if (getenv("XJREMOTE")) {
_xjadeo_bin = strdup(getenv("XJREMOTE")); // XXX TODO: free it?!
} else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {
} else if (find_file_in_search_path (Searchpath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {
_xjadeo_bin = xjadeo_file_path;
}
else if (Glib::file_test(X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) {

View file

@ -25,15 +25,15 @@
namespace ARDOUR {
/**
* return a SearchPath containing directories in which to look for
* return a Searchpath containing directories in which to look for
* control surface plugins.
*
* If ARDOUR_SURFACES_PATH is defined then the SearchPath returned
* If ARDOUR_SURFACES_PATH is defined then the Searchpath returned
* will contain only those directories specified in it, otherwise it will
* contain the user and system directories which may contain control
* surface plugins.
*/
PBD::SearchPath control_protocol_search_path ();
PBD::Searchpath control_protocol_search_path ();
} // namespace ARDOUR

View file

@ -24,10 +24,10 @@
namespace ARDOUR {
/**
* return a SearchPath containing directories in which to look for
* return a Searchpath containing directories in which to look for
* export_formats.
*/
PBD::SearchPath export_formats_search_path ();
PBD::Searchpath export_formats_search_path ();
} // namespace ARDOUR

View file

@ -38,10 +38,6 @@
#include "ardour/types.h"
#include "ardour/export_handler.h"
#ifdef SearchPath
#undef SearchPath
#endif
namespace ARDOUR
{
@ -106,7 +102,7 @@ class ExportProfileManager
std::vector<std::string> find_file (std::string const & pattern);
std::string export_config_dir;
PBD::SearchPath search_path;
PBD::Searchpath search_path;
/* Timespans */
public:

View file

@ -22,10 +22,6 @@
#include "pbd/search_path.h"
#ifdef SearchPath
#undef SearchPath
#endif
namespace ARDOUR {
/**
@ -45,14 +41,14 @@ namespace ARDOUR {
* @return the search path to be used when looking for per-system
* configuration files. This may include user configuration files.
*/
PBD::SearchPath ardour_config_search_path ();
PBD::Searchpath ardour_config_search_path ();
/**
* @return the search path to be used when looking for data files
* that could be shared by systems (h/w and configuration independent
* files, such as icons, XML files, etc)
*/
PBD::SearchPath ardour_data_search_path ();
PBD::Searchpath ardour_data_search_path ();
} // namespace ARDOUR

View file

@ -25,14 +25,14 @@
namespace ARDOUR {
/**
* return a SearchPath containing directories in which to look for
* return a Searchpath containing directories in which to look for
* LADSPA plugins.
*
* If LADSPA_PATH is defined then the SearchPath returned
* If LADSPA_PATH is defined then the Searchpath returned
* will contain the directories specified in it as well as the
* user and system directories.
*/
PBD::SearchPath ladspa_search_path ();
PBD::Searchpath ladspa_search_path ();
} // namespace ARDOUR

View file

@ -25,10 +25,10 @@
namespace ARDOUR {
/**
* return a SearchPath containing directories in which to look for
* return a Searchpath containing directories in which to look for
* lv2 plugins.
*/
PBD::SearchPath lv2_bundled_search_path ();
PBD::Searchpath lv2_bundled_search_path ();
} // namespace ARDOUR

View file

@ -24,15 +24,15 @@
namespace ARDOUR {
/**
* return a SearchPath containing directories in which to look for
* return a Searchpath containing directories in which to look for
* MIDI patch files ("*.midnam") aka MIDNAM files
*
* If ARDOUR_MIDI_PATCH_PATH is defined then the SearchPath returned
* If ARDOUR_MIDI_PATCH_PATH is defined then the Searchpath returned
* will contain only those directories specified in it, otherwise it will
* contain the user and system directories which may contain control
* surface plugins.
*/
PBD::SearchPath midi_patch_search_path ();
PBD::Searchpath midi_patch_search_path ();
} // namespace ARDOUR

View file

@ -24,15 +24,15 @@
namespace ARDOUR {
/**
* return a SearchPath containing directories in which to look for
* return a Searchpath containing directories in which to look for
* panner plugins.
*
* If ARDOUR_PANNER_PATH is defined then the SearchPath returned
* If ARDOUR_PANNER_PATH is defined then the Searchpath returned
* will contain only those directories specified in it, otherwise it will
* contain the user and system directories which may contain control
* surface plugins.
*/
PBD::SearchPath panner_search_path ();
PBD::Searchpath panner_search_path ();
} // namespace ARDOUR

View file

@ -30,10 +30,6 @@
#include "ardour/debug.h"
#include "ardour/control_protocol_manager.h"
#ifdef SearchPath
#undef SearchPath
#endif
#include "ardour/control_protocol_search_path.h"

View file

@ -33,14 +33,14 @@ using namespace PBD;
namespace ARDOUR {
SearchPath
Searchpath
control_protocol_search_path ()
{
SearchPath spath(user_config_directory ());
Searchpath spath(user_config_directory ());
spath += ardour_dll_directory ();
spath.add_subdirectory_to_paths (surfaces_dir_name);
spath += SearchPath(Glib::getenv(surfaces_env_variable_name));
spath += Searchpath(Glib::getenv(surfaces_env_variable_name));
return spath;
}

View file

@ -32,14 +32,14 @@ using namespace PBD;
namespace ARDOUR {
SearchPath
Searchpath
export_formats_search_path ()
{
SearchPath spath (ardour_data_search_path());
Searchpath spath (ardour_data_search_path());
spath.add_subdirectory_to_paths (export_formats_dir_name);
bool export_formats_path_defined = false;
SearchPath spath_env (Glib::getenv(export_env_variable_name, export_formats_path_defined));
Searchpath spath_env (Glib::getenv(export_env_variable_name, export_formats_path_defined));
if (export_formats_path_defined) {
spath += spath_env;

View file

@ -101,7 +101,7 @@ ardour_dll_directory ()
}
#ifdef PLATFORM_WINDOWS
SearchPath
Searchpath
windows_search_path ()
{
std::string dll_dir_path(g_win32_get_package_installation_directory_of_module(NULL));
@ -110,10 +110,10 @@ windows_search_path ()
}
#endif
SearchPath
Searchpath
ardour_config_search_path ()
{
static SearchPath search_path;
static Searchpath search_path;
if (search_path.empty()) {
search_path += user_config_directory();
@ -126,17 +126,17 @@ ardour_config_search_path ()
::exit (1);
}
search_path += SearchPath (s);
search_path += Searchpath (s);
#endif
}
return search_path;
}
SearchPath
Searchpath
ardour_data_search_path ()
{
static SearchPath search_path;
static Searchpath search_path;
if (search_path.empty()) {
search_path += user_config_directory();
@ -149,7 +149,7 @@ ardour_data_search_path ()
::exit (1);
}
search_path += SearchPath (s);
search_path += Searchpath (s);
#endif
}

View file

@ -388,7 +388,7 @@ void
ARDOUR::find_bindings_files (map<string,string>& files)
{
vector<std::string> found;
SearchPath spath = ardour_config_search_path();
Searchpath spath = ardour_config_search_path();
if (getenv ("ARDOUR_SAE")) {
Glib::PatternSpec pattern("*SAE-*.bindings");

View file

@ -584,7 +584,7 @@ ARDOUR::set_path_env_for_jack_autostart (const vector<std::string>& dirs)
#ifdef __APPLE__
// push it back into the environment so that auto-started JACK can find it.
// XXX why can't we just expect OS X users to have PATH set correctly? we can't ...
setenv ("PATH", SearchPath(dirs).to_string().c_str(), 1);
setenv ("PATH", Searchpath(dirs).to_string().c_str(), 1);
#else
(void) dirs;
#endif
@ -606,7 +606,7 @@ ARDOUR::get_jack_server_dir_paths (vector<std::string>& server_dir_paths)
server_dir_paths.push_back (Glib::path_get_dirname (execpath));
#endif
SearchPath sp(string(g_getenv("PATH")));
Searchpath sp(string(g_getenv("PATH")));
#ifdef PLATFORM_WINDOWS
gchar *install_dir = g_win32_get_package_installation_directory_of_module (NULL);

View file

@ -33,12 +33,12 @@ using namespace PBD;
namespace ARDOUR {
SearchPath
Searchpath
ladspa_search_path ()
{
SearchPath spath_env (Glib::getenv(ladspa_env_variable_name));
Searchpath spath_env (Glib::getenv(ladspa_env_variable_name));
SearchPath spath (user_config_directory ());
Searchpath spath (user_config_directory ());
spath += ardour_dll_directory ();
spath.add_subdirectory_to_paths (ladspa_dir_name);

View file

@ -29,10 +29,10 @@ using namespace PBD;
namespace ARDOUR {
SearchPath
Searchpath
lv2_bundled_search_path ()
{
SearchPath spath( ardour_dll_directory () );
Searchpath spath( ardour_dll_directory () );
spath.add_subdirectory_to_paths ("LV2");
return spath;

View file

@ -29,10 +29,6 @@
#include "ardour/session_directory.h"
#include "ardour/midi_patch_manager.h"
#ifdef SearchPath
#undef SearchPath
#endif
#include "ardour/midi_patch_search_path.h"
#include "i18n.h"
@ -107,7 +103,7 @@ MidiPatchManager::refresh()
_master_devices_by_model.clear();
_all_models.clear();
SearchPath search_path = midi_patch_search_path ();
Searchpath search_path = midi_patch_search_path ();
Glib::PatternSpec pattern (string("*.midnam"));
vector<std::string> result;

View file

@ -31,14 +31,14 @@ using namespace PBD;
namespace ARDOUR {
SearchPath
Searchpath
midi_patch_search_path ()
{
SearchPath spath (ardour_data_search_path());
Searchpath spath (ardour_data_search_path());
spath.add_subdirectory_to_paths(midi_patch_dir_name);
bool midi_patch_path_defined = false;
SearchPath spath_env (Glib::getenv(midi_patch_env_variable_name, midi_patch_path_defined));
Searchpath spath_env (Glib::getenv(midi_patch_env_variable_name, midi_patch_path_defined));
if (midi_patch_path_defined) {
spath += spath_env;

View file

@ -29,10 +29,6 @@
#include "ardour/debug.h"
#include "ardour/panner_manager.h"
#ifdef SearchPath
#undef SearchPath
#endif
#include "ardour/panner_search_path.h"
#include "i18n.h"

View file

@ -31,14 +31,14 @@ using namespace PBD;
namespace ARDOUR {
SearchPath
Searchpath
panner_search_path ()
{
SearchPath spath(user_config_directory ());
Searchpath spath(user_config_directory ());
spath += ardour_dll_directory ();
spath.add_subdirectory_to_paths(panner_dir_name);
spath += SearchPath(Glib::getenv(panner_env_variable_name));
spath += Searchpath(Glib::getenv(panner_env_variable_name));
return spath;
}

View file

@ -59,10 +59,6 @@
#include "ardour/plugin_manager.h"
#include "ardour/rc_configuration.h"
#ifdef SearchPath
#undef SearchPath
#endif
#include "ardour/ladspa_search_path.h"
#ifdef LV2_SUPPORT

View file

@ -94,10 +94,6 @@
#include "i18n.h"
#ifdef SearchPath
#undef SearchPath
#endif
namespace ARDOUR {
class MidiSource;
class Processor;
@ -4434,7 +4430,7 @@ Session::end_time_changed (framepos_t old)
std::vector<std::string>
Session::source_search_path (DataType type) const
{
SearchPath sp;
Searchpath sp;
if (session_dirs.size() == 1) {
switch (type) {
@ -4472,10 +4468,10 @@ Session::source_search_path (DataType type) const
switch (type) {
case DataType::AUDIO:
sp += SearchPath(config.get_audio_search_path ());
sp += Searchpath(config.get_audio_search_path ());
break;
case DataType::MIDI:
sp += SearchPath(config.get_midi_search_path ());
sp += Searchpath(config.get_midi_search_path ());
break;
}
@ -4485,7 +4481,7 @@ Session::source_search_path (DataType type) const
void
Session::ensure_search_path_includes (const string& path, DataType type)
{
SearchPath sp;
Searchpath sp;
if (path == ".") {
return;
@ -4493,10 +4489,10 @@ Session::ensure_search_path_includes (const string& path, DataType type)
switch (type) {
case DataType::AUDIO:
sp += SearchPath(config.get_audio_search_path ());
sp += Searchpath(config.get_audio_search_path ());
break;
case DataType::MIDI:
sp += SearchPath (config.get_midi_search_path ());
sp += Searchpath (config.get_midi_search_path ());
break;
}

View file

@ -384,7 +384,7 @@ Session::second_stage_init ()
string
Session::raid_path () const
{
SearchPath raid_search_path;
Searchpath raid_search_path;
for (vector<space_and_path>::const_iterator i = session_dirs.begin(); i != session_dirs.end(); ++i) {
raid_search_path += (*i).path;
@ -405,11 +405,11 @@ Session::setup_raid_path (string path)
session_dirs.clear ();
SearchPath search_path(path);
SearchPath sound_search_path;
SearchPath midi_search_path;
Searchpath search_path(path);
Searchpath sound_search_path;
Searchpath midi_search_path;
for (SearchPath::const_iterator i = search_path.begin(); i != search_path.end(); ++i) {
for (Searchpath::const_iterator i = search_path.begin(); i != search_path.end(); ++i) {
sp.path = *i;
sp.blocks = 0; // not needed
session_dirs.push_back (sp);

View file

@ -32,27 +32,23 @@
#include "ardour/filename_extensions.h"
#include "ardour/io.h"
#ifdef SearchPath
#undef SearchPath
#endif
using namespace std;
using namespace PBD;
namespace ARDOUR {
SearchPath
Searchpath
template_search_path ()
{
SearchPath spath (ardour_data_search_path());
Searchpath spath (ardour_data_search_path());
spath.add_subdirectory_to_paths(templates_dir_name);
return spath;
}
SearchPath
Searchpath
route_template_search_path ()
{
SearchPath spath (ardour_data_search_path());
Searchpath spath (ardour_data_search_path());
spath.add_subdirectory_to_paths(route_templates_dir_name);
return spath;
}
@ -101,7 +97,7 @@ find_session_templates (vector<TemplateInfo>& template_names)
{
vector<string *> *templates;
PathScanner scanner;
SearchPath spath (template_search_path());
Searchpath spath (template_search_path());
templates = scanner (spath.to_string(), template_filter, 0, true, true);
@ -137,7 +133,7 @@ find_route_templates (vector<TemplateInfo>& template_names)
{
vector<string *> *templates;
PathScanner scanner;
SearchPath spath (route_template_search_path());
Searchpath spath (route_template_search_path());
templates = scanner (spath.to_string(), route_template_filter, 0, false, true);

View file

@ -32,7 +32,7 @@ PluginsTest::test ()
pm.refresh ();
SearchPath ladspa_paths(ladspa_search_path ());
Searchpath ladspa_paths(ladspa_search_path ());
cout << "Number of Ladspa paths found: " << ladspa_paths.size () << endl;

View file

@ -1,4 +1,4 @@
// this is included first to avoid SearchPath definition on windows
// this is included first to avoid Searchpath definition on windows
#include "test_common.h"
#include "pbd/file_utils.h"

View file

@ -25,7 +25,7 @@
using namespace std;
PBD::SearchPath
PBD::Searchpath
test_search_path ()
{
#ifdef PLATFORM_WINDOWS

View file

@ -21,7 +21,7 @@
#include "pbd/search_path.h"
PBD::SearchPath test_search_path ();
PBD::Searchpath test_search_path ();
std::string new_test_output_dir ();

View file

@ -104,7 +104,7 @@ find_matching_files_in_directories (const vector<std::string>& paths,
}
void
find_matching_files_in_search_path (const SearchPath& search_path,
find_matching_files_in_search_path (const Searchpath& search_path,
const Glib::PatternSpec& pattern,
vector<std::string>& result)
{
@ -112,7 +112,7 @@ find_matching_files_in_search_path (const SearchPath& search_path,
}
bool
find_file_in_search_path(const SearchPath& search_path,
find_file_in_search_path(const Searchpath& search_path,
const string& filename,
std::string& result)
{

View file

@ -68,15 +68,15 @@ find_matching_files_in_directories (const std::vector<std::string>& directory_pa
std::vector<std::string>& result);
/**
* Takes a SearchPath and puts a list of all the files in the search path
* 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 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.
*/
void
find_matching_files_in_search_path (const SearchPath& search_path,
find_matching_files_in_search_path (const Searchpath& search_path,
const Glib::PatternSpec& pattern,
std::vector<std::string>& result);
@ -87,7 +87,7 @@ find_matching_files_in_search_path (const SearchPath& search_path,
* @return true If file is found within the search path.
*/
bool
find_file_in_search_path (const SearchPath& search_path,
find_file_in_search_path (const Searchpath& search_path,
const std::string& filename,
std::string& result);

View file

@ -20,36 +20,32 @@
#ifndef PBD_SEARCH_PATH_INCLUDED
#define PBD_SEARCH_PATH_INCLUDED
#ifdef SearchPath
#undef SearchPath
#endif
#include <string>
#include <vector>
namespace PBD {
/**
* @class SearchPath
* @class Searchpath
*
* The SearchPath class is a helper class for getting a
* The Searchpath class is a helper class for getting a
* vector of paths contained in a search path string where a
* "search path string" contains absolute directory paths
* separated by a colon(:) or a semi-colon(;) on windows.
*
* The SearchPath class does not test whether the paths exist
* The Searchpath class does not test whether the paths exist
* or are directories. It is basically just a container.
*/
class SearchPath : public std::vector<std::string>
class Searchpath : public std::vector<std::string>
{
public:
/**
* Create an empty SearchPath.
* Create an empty Searchpath.
*/
SearchPath ();
Searchpath ();
/**
* Initialize SearchPath from a string where the string contains
* Initialize Searchpath from a string where the string contains
* one or more absolute paths to directories which are delimited
* by a path separation character. The path delimeter is a
* colon(:) on unix and a semi-colon(;) on windows.
@ -59,15 +55,15 @@ public:
*
* @param search_path A path string.
*/
SearchPath (const std::string& search_path);
Searchpath (const std::string& search_path);
/**
* Initialize SearchPath from a vector of paths that may or may
* Initialize Searchpath from a vector of paths that may or may
* not exist.
*
* @param paths A vector of paths.
*/
SearchPath (const std::vector<std::string>& paths);
Searchpath (const std::vector<std::string>& paths);
/**
* @return a search path string.
@ -80,29 +76,29 @@ public:
/**
* Add all the directories in path to this.
*/
SearchPath& operator+= (const SearchPath& spath);
Searchpath& operator+= (const Searchpath& spath);
/**
* Add another directory path to the search path.
*/
SearchPath& operator+= (const std::string& directory_path);
Searchpath& operator+= (const std::string& directory_path);
/**
* Concatenate another SearchPath onto this.
* Concatenate another Searchpath onto this.
*/
SearchPath& operator+ (const SearchPath& other);
Searchpath& operator+ (const Searchpath& other);
/**
* Add another path to the search path.
*/
SearchPath& operator+ (const std::string& directory_path);
Searchpath& operator+ (const std::string& directory_path);
/**
* Add a sub-directory to each path in the search path.
* @param subdir The directory name, it should not contain
* any path separating tokens.
*/
SearchPath& add_subdirectory_to_paths (const std::string& subdir);
Searchpath& add_subdirectory_to_paths (const std::string& subdir);
protected:

View file

@ -37,12 +37,12 @@ const char * const path_delimiter = ":";
namespace PBD {
SearchPath::SearchPath ()
Searchpath::Searchpath ()
{
}
SearchPath::SearchPath (const string& path)
Searchpath::Searchpath (const string& path)
{
vector<std::string> tmp;
@ -51,13 +51,13 @@ SearchPath::SearchPath (const string& path)
}
}
SearchPath::SearchPath (const vector<std::string>& paths)
Searchpath::Searchpath (const vector<std::string>& paths)
{
add_directories (paths);
}
void
SearchPath::add_directory (const std::string& directory_path)
Searchpath::add_directory (const std::string& directory_path)
{
if (!directory_path.empty()) {
push_back(directory_path);
@ -65,7 +65,7 @@ SearchPath::add_directory (const std::string& directory_path)
}
void
SearchPath::add_directories (const vector<std::string>& paths)
Searchpath::add_directories (const vector<std::string>& paths)
{
for(vector<std::string>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
add_directory (*i);
@ -73,7 +73,7 @@ SearchPath::add_directories (const vector<std::string>& paths)
}
const string
SearchPath::to_string () const
Searchpath::to_string () const
{
string path;
@ -87,37 +87,37 @@ SearchPath::to_string () const
return path;
}
SearchPath&
SearchPath::operator+= (const SearchPath& spath)
Searchpath&
Searchpath::operator+= (const Searchpath& spath)
{
insert(end(), spath.begin(), spath.end());
return *this;
}
SearchPath&
SearchPath::operator+= (const std::string& directory_path)
Searchpath&
Searchpath::operator+= (const std::string& directory_path)
{
add_directory (directory_path);
return *this;
}
SearchPath&
SearchPath::operator+ (const std::string& directory_path)
Searchpath&
Searchpath::operator+ (const std::string& directory_path)
{
add_directory (directory_path);
return *this;
}
SearchPath&
SearchPath::operator+ (const SearchPath& spath)
Searchpath&
Searchpath::operator+ (const Searchpath& spath)
{
// concatenate paths into new SearchPath
// concatenate paths into new Searchpath
insert(end(), spath.begin(), spath.end());
return *this;
}
SearchPath&
SearchPath::add_subdirectory_to_paths (const string& subdir)
Searchpath&
Searchpath::add_subdirectory_to_paths (const string& subdir)
{
for (vector<std::string>::iterator i = begin(); i != end(); ++i) {
// should these new paths just be added to the end of

View file

@ -25,7 +25,7 @@
* in an installed location on windows or by setting an environment variable
* on unix.
*/
PBD::SearchPath
PBD::Searchpath
test_search_path ()
{
#ifdef PLATFORM_WINDOWS

View file

@ -21,6 +21,6 @@
#include "pbd/search_path.h"
PBD::SearchPath test_search_path ();
PBD::Searchpath test_search_path ();
#endif

View file

@ -106,7 +106,7 @@ static const char * const midimap_env_variable_name = "ARDOUR_MIDIMAPS_PATH";
static const char* const midi_map_dir_name = "midi_maps";
static const char* const midi_map_suffix = ".map";
SearchPath
Searchpath
system_midi_map_search_path ()
{
bool midimap_path_defined = false;
@ -116,7 +116,7 @@ system_midi_map_search_path ()
return spath_env;
}
SearchPath spath (ardour_data_search_path());
Searchpath spath (ardour_data_search_path());
spath.add_subdirectory_to_paths(midi_map_dir_name);
return spath;
}
@ -139,7 +139,7 @@ GenericMidiControlProtocol::reload_maps ()
{
vector<string *> *midi_maps;
PathScanner scanner;
SearchPath spath (system_midi_map_search_path());
Searchpath spath (system_midi_map_search_path());
spath += user_midi_map_directory ();
midi_maps = scanner (spath.to_string(), midi_map_filter, 0, false, true);

View file

@ -442,7 +442,7 @@ static const char * const devinfo_env_variable_name = "ARDOUR_MCP_PATH";
static const char* const devinfo_dir_name = "mcp";
static const char* const devinfo_suffix = ".device";
static SearchPath
static Searchpath
devinfo_search_path ()
{
bool devinfo_path_defined = false;
@ -452,7 +452,7 @@ devinfo_search_path ()
return spath_env;
}
SearchPath spath (ardour_data_search_path());
Searchpath spath (ardour_data_search_path());
spath.add_subdirectory_to_paths(devinfo_dir_name);
return spath;
@ -472,7 +472,7 @@ DeviceInfo::reload_device_info ()
vector<string> s;
vector<string *> *devinfos;
PathScanner scanner;
SearchPath spath (devinfo_search_path());
Searchpath spath (devinfo_search_path());
devinfos = scanner (spath.to_string(), devinfo_filter, 0, false, true);
device_info.clear ();

View file

@ -55,7 +55,7 @@ static const char * const devprofile_env_variable_name = "ARDOUR_MCP_PATH";
static const char* const devprofile_dir_name = "mcp";
static const char* const devprofile_suffix = ".profile";
static SearchPath
static Searchpath
devprofile_search_path ()
{
bool devprofile_path_defined = false;
@ -65,7 +65,7 @@ devprofile_search_path ()
return spath_env;
}
SearchPath spath (ardour_data_search_path());
Searchpath spath (ardour_data_search_path());
spath.add_subdirectory_to_paths(devprofile_dir_name);
return spath;
@ -91,7 +91,7 @@ DeviceProfile::reload_device_profiles ()
vector<string> s;
vector<string *> *devprofiles;
PathScanner scanner;
SearchPath spath (devprofile_search_path());
Searchpath spath (devprofile_search_path());
devprofiles = scanner (spath.to_string(), devprofile_filter, 0, false, true);
device_profiles.clear ();