From 290be9610e32bb427dd0456e4b1e26526c479004 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 | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/node.c b/src/node.c index ea9d174d..c4620671 100644 --- a/src/node.c +++ b/src/node.c @@ -11,6 +11,7 @@ #include "serd/buffer.h" #include "serd/node.h" #include "serd/string.h" +#include "serd/string_view.h" #include "serd/uri.h" #include @@ -449,6 +450,14 @@ serd_node_length(const SerdNode* const node) return node->length; } +SerdStringView +serd_node_string_view(const SerdNode* const node) +{ + const SerdStringView r = {(const char*)(node + 1), node->length}; + + return r; +} + SerdNodeFlags serd_node_flags(const SerdNode* const node) { -- cgit v1.2.1