C++98 compatible iterator erase
[ardour.git] / libs / pbd / search_path.cc
index d1dc8c39f0c5a8782913695db7d57e498ff8a154..46292ef1f353dab4e8286dfd60353f82e7e1c730 100644 (file)
@@ -163,6 +163,17 @@ Searchpath::add_subdirectory_to_paths (const string& 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.
  */