summaryrefslogtreecommitdiffstats
path: root/sratom
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-01 06:39:57 +0000
committerDavid Robillard <d@drobilla.net>2012-03-01 06:39:57 +0000
commit6408ee7d93ed041a053627e3506c444e215654d4 (patch)
treeda8888efd3d243018e9d56e09a60ef0aecfb5c01 /sratom
parent6e4c4ee8a1fccebedf48b750151a258a559fc50b (diff)
downloadsratom-6408ee7d93ed041a053627e3506c444e215654d4.tar.gz
sratom-6408ee7d93ed041a053627e3506c444e215654d4.tar.bz2
sratom-6408ee7d93ed041a053627e3506c444e215654d4.zip
Implement Turtle reading (except for atom:Vector).
git-svn-id: http://svn.drobilla.net/lad/trunk/sratom@4006 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'sratom')
-rw-r--r--sratom/sratom.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/sratom/sratom.h b/sratom/sratom.h
index 68d1390..fdbad78 100644
--- a/sratom/sratom.h
+++ b/sratom/sratom.h
@@ -24,7 +24,9 @@
#include <stdint.h>
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
+#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "serd/serd.h"
+#include "sord/sord.h"
#ifdef SRATOM_SHARED
# ifdef _WIN32
@@ -75,18 +77,32 @@ sratom_free(Sratom* sratom);
/**
Write an Atom to RDF.
+ The resulting serialised atom is written to @p writer.
*/
SRATOM_API
void
sratom_write(Sratom* sratom,
+ SerdWriter* writer,
uint32_t flags,
const SerdNode* subject,
const SerdNode* predicate,
- uint32_t type_urid,
+ uint32_t type,
uint32_t size,
const void* body);
/**
+ Read an Atom from RDF.
+ The resulting atom will be written to @p forge.
+*/
+SRATOM_API
+void
+sratom_read(Sratom* sratom,
+ LV2_Atom_Forge* forge,
+ SordWorld* world,
+ SordModel* model,
+ const SordNode* node);
+
+/**
Serialise an Atom to a Turtle string.
The returned string must be free()'d by the caller.
*/
@@ -95,11 +111,22 @@ char*
sratom_to_turtle(Sratom* sratom,
const SerdNode* subject,
const SerdNode* predicate,
- uint32_t type_urid,
+ uint32_t type,
uint32_t size,
const void* body);
/**
+ Read an Atom from a Turtle string.
+ The returned atom must be free()'d by the caller.
+*/
+SRATOM_API
+LV2_Atom*
+sratom_from_turtle(Sratom* sratom,
+ const SerdNode* subject,
+ const SerdNode* predicate,
+ const char* str);
+
+/**
@}
*/