From d243368f8e2f79a125a5858223f71fb40fe84525 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 24 Feb 2021 15:49:21 -0500 Subject: Add serd_node_uri_view() --- src/node.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/node.c') diff --git a/src/node.c b/src/node.c index 69034603..7508f45d 100644 --- a/src/node.c +++ b/src/node.c @@ -507,6 +507,18 @@ serd_node_string_view(const SerdNode* SERD_NONNULL node) return result; } +SerdURIView +serd_node_uri_view(const SerdNode* SERD_NONNULL node) +{ + SerdURIView result = SERD_URI_NULL; + + if (node->type == SERD_URI) { + serd_uri_parse(serd_node_string(node), &result); + } + + return result; +} + const SerdNode* serd_node_datatype(const SerdNode* node) { -- cgit v1.2.1