diff options
author | David Robillard <d@drobilla.net> | 2011-05-18 02:17:20 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-18 02:17:20 +0000 |
commit | 602ad00d48276646ce85a9b472da6462eb323bae (patch) | |
tree | 66eee25ad4020219d450834559626ff242a6cef2 /sord/sord.h | |
parent | d6b69d9930b6bd918db346f8a03a99ed1e25cf65 (diff) | |
download | sord-602ad00d48276646ce85a9b472da6462eb323bae.tar.gz sord-602ad00d48276646ce85a9b472da6462eb323bae.tar.bz2 sord-602ad00d48276646ce85a9b472da6462eb323bae.zip |
Add sordi-i option to select input syntax.
Add syntax parameter to sord_write_string and sord_write_file.
Remove read functions in favour of sord_new_reader and direct use of SerdReader API.
Bump version to 0.3.0.
git-svn-id: http://svn.drobilla.net/sord/trunk@121 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'sord/sord.h')
-rw-r--r-- | sord/sord.h | 62 |
1 files changed, 19 insertions, 43 deletions
diff --git a/sord/sord.h b/sord/sord.h index 62bef78..5796a6a 100644 --- a/sord/sord.h +++ b/sord/sord.h @@ -265,10 +265,20 @@ bool sord_node_equals(const SordNode* a, const SordNode* b); +/** + Return a SordNode as a SerdNode. + + The returned node is shared and must not be freed or modified. +*/ SORD_API const SerdNode* sord_node_to_serd_node(const SordNode* node); +/** + Create a new SordNode from a SerdNode. + + The returned node must be freed using sord_node_free. +*/ SORD_API SordNode* sord_node_from_serd_node(SordWorld* world, @@ -426,41 +436,14 @@ sord_quad_match(const SordQuad x, const SordQuad y); */ /** - Read a file into a model. - - The @c base_uri may be NULL, in which case @c uri will be used. -*/ -SORD_API -bool -sord_read_file(SordModel* model, - SerdEnv* env, - const uint8_t* uri, - const uint8_t* base_uri, - SordNode* graph, - const uint8_t* blank_prefix); - -/** - Read a file handle into a model. -*/ -SORD_API -bool -sord_read_file_handle(SordModel* model, - SerdEnv* env, - FILE* fd, - const uint8_t* name, - const uint8_t* base_uri, - SordNode* graph, - const uint8_t* blank_prefix); - -/** - Read a string into a model. + Return a reader that will read into @c model. */ SORD_API -bool -sord_read_string(SordModel* model, - SerdEnv* env, - const uint8_t* str, - const uint8_t* base_uri); +SerdReader* +sord_new_reader(SordModel* model, + SerdEnv* env, + SerdSyntax syntax, + SordNode* graph); /** Write a model to a file. @@ -469,24 +452,16 @@ SORD_API bool sord_write_file(SordModel* model, SerdEnv* env, + SerdSyntax syntax, const uint8_t* uri, SordNode* graph, const uint8_t* blank_prefix); /** - Write a model to a file handle. + Write a model to a writer. */ SORD_API bool -sord_write_file_handle(SordModel* model, - SerdEnv* env, - FILE* fd, - const uint8_t* base_uri, - SordNode* graph, - const uint8_t* blank_prefix); - -SORD_API -bool sord_write_writer(SordModel* model, SerdWriter* writer, SordNode* graph); @@ -500,6 +475,7 @@ SORD_API uint8_t* sord_write_string(SordModel* model, SerdEnv* env, + SerdSyntax syntax, const uint8_t* base_uri); /** |