summaryrefslogtreecommitdiffstats
path: root/lilv
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-03-07 08:42:56 +0000
committerDavid Robillard <d@drobilla.net>2015-03-07 08:42:56 +0000
commit1b420b15b3c88ebbcd6789f78b69bd284e0a98f7 (patch)
tree2871ea66f0651b2a43ff98c6f107e1654ee3aeed /lilv
parentcd320a7ccd392a5da2df31ec5edc9b07db5befab (diff)
downloadlilv-1b420b15b3c88ebbcd6789f78b69bd284e0a98f7.tar.gz
lilv-1b420b15b3c88ebbcd6789f78b69bd284e0a98f7.tar.bz2
lilv-1b420b15b3c88ebbcd6789f78b69bd284e0a98f7.zip
Add support for state deletion.
Add lilv_node_get_path(). Add lilv_state_get_uri(). Add lilv_state_delete(). Fix creation of duplicate manifest entries when saving state. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5617 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'lilv')
-rw-r--r--lilv/lilv.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/lilv/lilv.h b/lilv/lilv.h
index 2248df2..e907789 100644
--- a/lilv/lilv.h
+++ b/lilv/lilv.h
@@ -259,6 +259,14 @@ LILV_API const char*
lilv_node_as_string(const LilvNode* value);
/**
+ Return the path of a file URI node.
+ Returns NULL if `value` is not a file URI.
+ Returned value must be freed by caller.
+*/
+LILV_API char*
+lilv_node_get_path(const LilvNode* value, char** hostname);
+
+/**
Return whether this value is a decimal literal.
*/
LILV_API bool
@@ -1342,6 +1350,14 @@ LILV_API const LilvNode*
lilv_state_get_plugin_uri(const LilvState* state);
/**
+ Get the URI of `state`.
+
+ This may return NULL if the state has not been saved and has no URI.
+*/
+LILV_API const LilvNode*
+lilv_state_get_uri(const LilvState* state);
+
+/**
Get the label of `state`.
*/
LILV_API const char*
@@ -1462,6 +1478,24 @@ lilv_state_to_string(LilvWorld* world,
const char* base_uri);
/**
+ Unload a state from the world and delete all associated files.
+ @param world The world.
+ @param state State to remove from the system.
+
+ This function DELETES FILES/DIRECTORIES FROM THE FILESYSTEM! It is intended
+ for removing user-saved presets, but can delete any state the user has
+ permission to delete, including presets shipped with plugins.
+
+ The rdfs:seeAlso file for the state will be removed. The entry in the
+ bundle's manifest.ttl is removed, and if this results in an empty manifest,
+ then the manifest file is removed. If this results in an empty bundle, then
+ the bundle directory is removed as well.
+*/
+LILV_API int
+lilv_state_delete(LilvWorld* world,
+ const LilvState* state);
+
+/**
@}
@name Scale Point
@{