Fix Searchpath::operator+ to return by value rather than reference and not modify...
[ardour.git] / libs / pbd / pbd / search_path.h
index e4c6c078478bc478f190fb2a484108c31bf01d71..74ac764dc0b6febba25590a14947b4f6b710e933 100644 (file)
@@ -90,12 +90,22 @@ public:
        /**
         * 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.
@@ -108,6 +118,8 @@ protected:
 
        LIBPBD_TEMPLATE_MEMBER_API void add_directory (const std::string& directory_path);
        LIBPBD_TEMPLATE_MEMBER_API void add_directories (const std::vector<std::string>& paths);
+       LIBPBD_TEMPLATE_MEMBER_API void remove_directory (const std::string& directory_path);
+       LIBPBD_TEMPLATE_MEMBER_API void remove_directories (const std::vector<std::string>& paths);
 };
 
 LIBPBD_API void export_search_path (const std::string& base_dir, const char* varname, const char* dir);