From 2607dd857a2a518ba472208bf0237c6cd0c59b32 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 20 Feb 2021 13:53:52 -0500 Subject: Add serd_node_string_view() --- src/node.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/node.c') diff --git a/src/node.c b/src/node.c index 14efddd3..69034603 100644 --- a/src/node.c +++ b/src/node.c @@ -499,6 +499,14 @@ serd_node_length(const SerdNode* node) return node->n_bytes; } +SerdStringView +serd_node_string_view(const SerdNode* SERD_NONNULL node) +{ + const SerdStringView result = {(const char*)(node + 1), node->n_bytes}; + + return result; +} + const SerdNode* serd_node_datatype(const SerdNode* node) { -- cgit v1.2.1