From d1a185c160bf8767e9001a6357f46ac6cfc6f94d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 12 May 2011 16:43:42 +0000 Subject: 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 --- sord/sord.h | 57 +++++++++++++++++++++------------------------------------ 1 file changed, 21 insertions(+), 36 deletions(-) (limited to 'sord') 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* @@ -200,18 +185,6 @@ sord_new_literal(SordWorld* world, const uint8_t* str, 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). @@ -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 -- cgit v1.2.1