From 12f165575f75916d4ec6fe6f200810b27c5c084f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 4 Feb 2018 12:40:45 +0100 Subject: Add node accessor API --- serd/serd.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'serd') diff --git a/serd/serd.h b/serd/serd.h index ba285255..0909dcc7 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -605,6 +605,34 @@ SERD_API SerdNode serd_node_new_blob(const void* buf, size_t size, bool wrap_lines); +/** + Return the type of a node (SERD_URI, SERD_BLANK, or SERD_LITERAL). +*/ +SERD_API +SerdType +serd_node_get_type(const SerdNode* node); + +/** + Return the string value of a node. +*/ +SERD_API +const char* +serd_node_get_string(const SerdNode* node); + +/** + Return the length of the string value of a node in bytes. +*/ +SERD_API +size_t +serd_node_get_length(const SerdNode* node); + +/** + Return the flags (string properties) of a node. +*/ +SERD_API +SerdNodeFlags +serd_node_get_flags(const SerdNode* node); + /** Free any data owned by `node`. -- cgit v1.2.1