diff options
author | David Robillard <d@drobilla.net> | 2011-05-12 16:43:42 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-12 16:43:42 +0000 |
commit | d1a185c160bf8767e9001a6357f46ac6cfc6f94d (patch) | |
tree | 23bc229896bc71ec3316db2c6dc5bac779d35ed8 /sord/sord.h | |
parent | b1992a03139b64e718eeaf87686cce8c7c9134d1 (diff) | |
download | sord-d1a185c160bf8767e9001a6357f46ac6cfc6f94d.tar.gz sord-d1a185c160bf8767e9001a6357f46ac6cfc6f94d.tar.bz2 sord-d1a185c160bf8767e9001a6357f46ac6cfc6f94d.zip |
Expose sord_node_from_serd_node.
Remove _counted node constructor methods.
Use SerdNode directly for equivalent fields in SordNode.
git-svn-id: http://svn.drobilla.net/sord/trunk@110 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'sord/sord.h')
-rw-r--r-- | sord/sord.h | 57 |
1 files changed, 21 insertions, 36 deletions
diff --git a/sord/sord.h b/sord/sord.h index 29e4299..4941291 100644 --- a/sord/sord.h +++ b/sord/sord.h @@ -153,45 +153,30 @@ sord_world_free(SordWorld* world); */ /** - Get a URI node from a string which will be measured. + Get a URI node from a string. - Use sord_get_uri_counted instead if the length of @c str is known. + Note this function measures @a str, which is a common bottleneck. + Use sord_node_from_serd_node instead if @a str is already measured. */ SORD_API SordNode* sord_new_uri(SordWorld* world, const uint8_t* str); /** - Get a URI node from a measured string. -*/ -SORD_API -SordNode* -sord_new_uri_counted(SordWorld* world, - const uint8_t* str, - size_t str_len); - -/** - Get a blank node from a string which will be measured. + Get a blank node from a string. - Use sord_get_blank_counted instead if the length of @c str is known. + Note this function measures @a str, which is a common bottleneck. + Use sord_node_from_serd_node instead if @a str is already measured. */ SORD_API SordNode* sord_new_blank(SordWorld* world, const uint8_t* str); /** - Get a blank node from a measured string. -*/ -SORD_API -SordNode* -sord_new_blank_counted(SordWorld* world, - const uint8_t* str, - size_t str_len); - -/** - Get a literal node from a string which will be measured. + Get a literal node from a string. - Use sord_get_literal_counted instead if the length of @c str is known. + Note this function measures @a str, which is a common bottleneck. + Use sord_node_from_serd_node instead if @a str is already measured. */ SORD_API SordNode* @@ -201,18 +186,6 @@ sord_new_literal(SordWorld* world, const char* lang); /** - Get a literal node from a measured string. -*/ -SORD_API -SordNode* -sord_new_literal_counted(SordWorld* world, - SordNode* datatype, - const uint8_t* str, - size_t str_len, - SerdNodeFlags flags, - const char* lang); - -/** Copy a node (i.e. obtain a reference). Node that since nodes are interned and reference counted, this does not @@ -292,6 +265,18 @@ bool sord_node_equals(const SordNode* a, const SordNode* b); +SORD_API +const SerdNode* +sord_node_to_serd_node(const SordNode* node); + +SORD_API +SordNode* +sord_node_from_serd_node(SordWorld* world, + SerdEnv* env, + const SerdNode* node, + const SerdNode* datatype, + const SerdNode* lang); + /** @} @name Model |