Save LV2 presets with relative URIs to their own bundle, in the same style as Jalv.
[ardour.git] / libs / ardour / utils.cc
index d034eea6ee91df5f72694a9b8c8360d265724c3d..ad0823ddaf1947848fc0f3ab1336503716b99af6 100644 (file)
@@ -111,6 +111,17 @@ legalize_for_universal_path (const string& str)
        return replace_chars (str, "<>:\"/\\|?*");
 }
 
+/** Legalize for a URI path component.  This is like
+ * legalize_for_universal_path, but stricter, disallowing spaces and hash.
+ * This avoids %20 escapes in URIs, but probably needs work to be more strictly
+ * correct.
+ */
+string
+legalize_for_uri (const string& str)
+{
+       return replace_chars (str, "<>:\"/\\|?* #");
+}
+
 /** take an arbitrary string as an argument, and return a version of it
  * suitable for use as a path (directory/folder name). This is the Ardour 2.X
  * version of this code, which used an approach that came to be seen as