/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
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
+ // should these new paths just be added to the end of
// the search path rather than replace?
*i = Glib::build_filename (*i, subdir);
}
-
+
return *this;
}
+bool
+Searchpath::contains (const string& path) const
+{
+ std::vector<std::string>::const_iterator i = find(begin(), end(), path);
+
+ if (i == end()) {
+ return false;
+ }
+ return true;
+}
+
/* This is not part of the Searchpath object, but is closely related to the
* whole idea, and we put it here for convenience.
*/
-void
+void
export_search_path (const string& base_dir, const char* varname, const char* dir)
{
string path;