aboutsummaryrefslogtreecommitdiffstats
path: root/src/node.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-02-20 13:53:52 -0500
committerDavid Robillard <d@drobilla.net>2021-03-07 15:32:24 -0500
commit2607dd857a2a518ba472208bf0237c6cd0c59b32 (patch)
tree3bd44d99a2d0e82e9b13dff4053b29fe0b1f11ba /src/node.c
parent6f03ae92415a7758fdc74f6720ec4955bc67fc0c (diff)
downloadserd-2607dd857a2a518ba472208bf0237c6cd0c59b32.tar.gz
serd-2607dd857a2a518ba472208bf0237c6cd0c59b32.tar.bz2
serd-2607dd857a2a518ba472208bf0237c6cd0c59b32.zip
Add serd_node_string_view()
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c8
1 files changed, 8 insertions, 0 deletions
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)
{