Honor attack and release parameters in a-comp's inline graph
[ardour.git] / libs / pbd / search_path.cc
index 1d931a546d93b9b83d2bf858bc964cf2523746a4..46292ef1f353dab4e8286dfd60353f82e7e1c730 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    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
@@ -155,19 +155,30 @@ 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 
+               // 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;