From a650d2ad2d4785c40405854740e70f487ae1016a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 4 Feb 2018 12:40:45 +0100 Subject: Add node accessor API --- include/serd/serd.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/serd') diff --git a/include/serd/serd.h b/include/serd/serd.h index 3c058b91..b14cf24d 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -577,6 +577,26 @@ SERD_API SerdNode serd_node_copy(const SerdNode* SERD_NULLABLE node); +/// Return the type of a node (SERD_URI, SERD_BLANK, or SERD_LITERAL) +SERD_PURE_API +SerdNodeType +serd_node_type(const SerdNode* SERD_NONNULL node); + +/// Return the node's string +SERD_PURE_API +const char* SERD_NONNULL +serd_node_string(const SerdNode* SERD_NONNULL node); + +/// Return the length of the node's string in bytes (excluding terminator) +SERD_PURE_API +size_t +serd_node_length(const SerdNode* SERD_NONNULL node); + +/// Return the flags (string properties) of a node +SERD_PURE_API +SerdNodeFlags +serd_node_flags(const SerdNode* SERD_NONNULL node); + /// Return true iff `a` is equal to `b` SERD_PURE_API bool -- cgit v1.2.1