summaryrefslogtreecommitdiffstats
path: root/slv2/value.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-05-08 03:30:37 +0000
committerDavid Robillard <d@drobilla.net>2007-05-08 03:30:37 +0000
commitf6ff6e487201bdd94e584397ce829daaa424aba9 (patch)
treeaedf571fe2c1db5d3d3cd1511805e51aca64a75e /slv2/value.h
parent816279720d70902bf1beba5a2aaaf135707ae77f (diff)
downloadlilv-f6ff6e487201bdd94e584397ce829daaa424aba9.tar.gz
lilv-f6ff6e487201bdd94e584397ce829daaa424aba9.tar.bz2
lilv-f6ff6e487201bdd94e584397ce829daaa424aba9.zip
Reworked simple query API to allow passing either QName or URI predicates.
Hack around a Rasqal bug for the above (URI predicates). Clean up exposed names for greppability and to not violate user namespace. Fixed slv2_plugin_get_value and slv2_plugin_get_value_for_resource. git-svn-id: http://svn.drobilla.net/lad/slv2@517 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'slv2/value.h')
-rw-r--r--slv2/value.h63
1 files changed, 62 insertions, 1 deletions
diff --git a/slv2/value.h b/slv2/value.h
index abc7a57..2d0fb51 100644
--- a/slv2/value.h
+++ b/slv2/value.h
@@ -31,12 +31,48 @@ extern "C" {
*/
+#if 0
+/** Wrap a URI string (e.g. "http://example.org/foo") as an SLV2Value.
+ *
+ * The result is returned by value and refers directly to \a uri, it
+ * does not need to be freed by the caller - calling slv2_value_free
+ * on the returned value will destroy \a uri.
+ */
+SLV2Value
+slv2_uri(const char* uri);
+
+
+/** Wrap a QName string (e.g. "lv2:Plugin") as an SLV2Value.
+ *
+ * The result is returned by value and refers directly to \a uri, it
+ * does not need to be freed by the caller - calling slv2_value_free
+ * on the returned value will destroy \a qname.
+ */
+SLV2Value
+slv2_qname(const char* qname);
+#endif
+
+
/** Return whether two values are equivalent.
*/
bool
slv2_value_equals(SLV2Value value, SLV2Value other);
+/** Return this value as a Turtle/SPARQL token.
+ * Examples:
+ * <http://example.org/foo>
+ * doap:name
+ * "this is a string"
+ * 1.0
+ * 1
+ *
+ * Returned string is newly allocation and must be freed by caller.
+ */
+char*
+slv2_value_get_turtle_token(SLV2Value value);
+
+
/** Return whether the value is a URI (resource).
*
* Time = O(1)
@@ -47,7 +83,8 @@ slv2_value_is_uri(SLV2Value value);
/** Return this value as a URI string, e.g. "http://example.org/foo".
*
- * Valid to call only if slv2_value_is_uri(\a value) returns true.
+ * Valid to call only if slv2_value_is_uri(\a value) or
+ * slv2_value_is_qname(\a value) returns true.
* Returned value is owned by \a value and must not be freed by caller.
*
* Time = O(1)
@@ -56,6 +93,30 @@ const char*
slv2_value_as_uri(SLV2Value value);
+#if 0
+/** Return whether the value is a QName ("qualified name", a prefixed URI).
+ *
+ * A QName will return true for both this, and slv2_value_is_uri.
+ * slv2_value_as_uri and slv2_value_as_qname will both return appropriately.
+ *
+ * Time = O(1)
+ */
+bool
+slv2_value_is_qname(SLV2Value value);
+
+
+/** Return this value as a QName string, e.g. "lv2:Plugin".
+ *
+ * Valid to call only if slv2_value_is_qname(\a value) returns true.
+ * Returned value is owned by \a value and must not be freed by caller.
+ *
+ * Time = O(1)
+ */
+const char*
+slv2_value_as_qname(SLV2Value value);
+#endif
+
+
/** Return whether this value is a literal (i.e. not a URI).
*
* Returns true if \a value is a string or numeric value.