From 6408ee7d93ed041a053627e3506c444e215654d4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 1 Mar 2012 06:39:57 +0000 Subject: Implement Turtle reading (except for atom:Vector). git-svn-id: http://svn.drobilla.net/lad/trunk/sratom@4006 a436a847-0d15-0410-975c-d299462d15a1 --- sratom/sratom.h | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'sratom/sratom.h') 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 #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,17 +77,31 @@ 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,10 +111,21 @@ 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); + /** @} */ -- cgit v1.2.1