From ff9510dc36fb3d6c5a85e3f4d41220c59b26ee93 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 21 Jan 2011 06:28:23 +0000 Subject: Preliminary support for writing abbreviated Turtle. git-svn-id: http://svn.drobilla.net/serd/trunk@22 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- serd/serd.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'serd') diff --git a/serd/serd.h b/serd/serd.h index 8efaab20..d350cf4c 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -244,10 +244,17 @@ serd_reader_free(SerdReader reader); * @{ */ +typedef enum { + SERD_STYLE_ABBREVIATED = 1, + SERD_STYLE_ASCII = 1 << 1, + SERD_STYLE_ESCAPE_ +} SerdStyle; + /** Create a new RDF writer. */ SERD_API SerdWriter serd_writer_new(SerdSyntax syntax, + SerdStyle style, SerdNamespaces ns, const SerdURI* base_uri, SerdSink sink, @@ -258,12 +265,19 @@ SERD_API void serd_writer_free(SerdWriter writer); -/** Set the base URI of writer. */ +/** Set the current output base URI. */ SERD_API void serd_writer_set_base_uri(SerdWriter writer, const SerdURI* uri); +/** Set the current output base URI. */ +SERD_API +void +serd_writer_set_prefix(SerdWriter writer, + const SerdString* name, + const SerdString* uri); + /** Write a statement. */ SERD_API bool @@ -278,6 +292,11 @@ serd_writer_write_statement(SerdWriter writer, const SerdString* object_datatype, const SerdString* object_lang); +/** Finish a write. */ +SERD_API +void +serd_writer_finish(SerdWriter writer); + /** @} */ /** @} */ -- cgit v1.2.1