aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-02-20 13:53:52 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 16:27:02 -0500
commit290be9610e32bb427dd0456e4b1e26526c479004 (patch)
tree0bced58585c4d8a9977415fcaf9354c956626102 /src
parente80312a5ac9cdeaaa0d4f81e7aa258572d695c74 (diff)
downloadserd-290be9610e32bb427dd0456e4b1e26526c479004.tar.gz
serd-290be9610e32bb427dd0456e4b1e26526c479004.tar.bz2
serd-290be9610e32bb427dd0456e4b1e26526c479004.zip
Add serd_node_string_view()
Diffstat (limited to 'src')
-rw-r--r--src/node.c9
1 files changed, 9 insertions, 0 deletions
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 <assert.h>
@@ -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)
{