try just removing all PLATFORM_WINDOWS conditionals in ipmidi code to see if it will...
[ardour.git] / libs / pbd / pbd / search_path.h
index e4c6c078478bc478f190fb2a484108c31bf01d71..d287782acaf63435c2155631b99ad4d9eef5f39f 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
@@ -31,8 +31,8 @@ namespace PBD {
  * @class Searchpath
  *
  * 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 
+ * 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
@@ -48,13 +48,13 @@ public:
 
        /**
         * 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 
+        * 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.
         *
         * Each path contained in the search path may or may not resolve to
         * an existing directory in the filesystem.
-        * 
+        *
         * @param search_path A path string.
         */
        LIBPBD_TEMPLATE_MEMBER_API Searchpath (const std::string& search_path);
@@ -86,28 +86,58 @@ public:
         * Add another directory path to the search path.
         */
        LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+= (const std::string& directory_path);
-       
+
        /**
         * Concatenate another Searchpath onto this.
         */
-       LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+ (const Searchpath& other);
-       
+       LIBPBD_TEMPLATE_MEMBER_API const Searchpath operator+ (const Searchpath& other);
+
        /**
         * Add another path to the search path.
         */
-       LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+ (const std::string& directory_path);
+       LIBPBD_TEMPLATE_MEMBER_API const Searchpath operator+ (const std::string& directory_path);
+
+       /**
+        * Remove all the directories in path from this.
+        */
+       LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator-= (const Searchpath& spath);
+
+       /**
+        * Remove a directory path from the search path.
+        */
+       LIBPBD_TEMPLATE_MEMBER_API 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 
+        * @param subdir The directory name, it should not contain
         * any path separating tokens.
         */
        LIBPBD_TEMPLATE_MEMBER_API Searchpath& add_subdirectory_to_paths (const std::string& subdir);
 
-protected:
-
+       /**
+        * Add directory_path to this Searchpath.
+        */
        LIBPBD_TEMPLATE_MEMBER_API void add_directory (const std::string& directory_path);
+
+       /**
+        * Add directories in paths to this Searchpath.
+        */
        LIBPBD_TEMPLATE_MEMBER_API void add_directories (const std::vector<std::string>& paths);
+
+       /**
+        * Remove directory_path from this Searchpath.
+        */
+       LIBPBD_TEMPLATE_MEMBER_API void remove_directory (const std::string& directory_path);
+
+       /**
+        * Remove all the directories in paths from this Searchpath.
+        */
+       LIBPBD_TEMPLATE_MEMBER_API void remove_directories (const std::vector<std::string>& paths);
+
+       /**
+        * @return true if Searchpath already contains path
+        */
+       LIBPBD_TEMPLATE_MEMBER_API bool contains (const std::string& path) const;
 };
 
 LIBPBD_API void export_search_path (const std::string& base_dir, const char* varname, const char* dir);