From 562191c700143fc867092d828e850c81137a73e4 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 fdebc4d1..c0a8d013 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -602,6 +602,34 @@ SERD_API SerdNode serd_node_copy(const SerdNode* node); +/** + Return the type of a node (SERD_URI, SERD_BLANK, or SERD_LITERAL). +*/ +SERD_API +SerdType +serd_node_type(const SerdNode* node); + +/** + Return the string value of a node. +*/ +SERD_API +const char* +serd_node_string(const SerdNode* node); + +/** + Return the length of the string value of a node in bytes. +*/ +SERD_API +size_t +serd_node_length(const SerdNode* node); + +/** + Return the flags (string properties) of a node. +*/ +SERD_API +SerdNodeFlags +serd_node_flags(const SerdNode* node); + /** Return true iff `a` is equal to `b`. */ -- cgit v1.2.1