diff options
author | David Robillard <d@drobilla.net> | 2021-02-20 13:53:52 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 16:27:02 -0500 |
commit | 290be9610e32bb427dd0456e4b1e26526c479004 (patch) | |
tree | 0bced58585c4d8a9977415fcaf9354c956626102 /include/serd/node.h | |
parent | e80312a5ac9cdeaaa0d4f81e7aa258572d695c74 (diff) | |
download | serd-290be9610e32bb427dd0456e4b1e26526c479004.tar.gz serd-290be9610e32bb427dd0456e4b1e26526c479004.tar.bz2 serd-290be9610e32bb427dd0456e4b1e26526c479004.zip |
Add serd_node_string_view()
Diffstat (limited to 'include/serd/node.h')
-rw-r--r-- | include/serd/node.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/serd/node.h b/include/serd/node.h index eb4f8c9e..75725516 100644 --- a/include/serd/node.h +++ b/include/serd/node.h @@ -5,6 +5,7 @@ #define SERD_NODE_H #include "serd/attributes.h" +#include "serd/string_view.h" #include "serd/uri.h" #include <stdbool.h> @@ -241,6 +242,15 @@ SERD_CONST_API const char* SERD_NONNULL serd_node_string(const SerdNode* SERD_NONNULL node); /** + Return a view of the string in a node. + + This is a convenience wrapper for serd_node_string() and serd_node_length() + that can be used to get both in a single call. +*/ +SERD_PURE_API SerdStringView +serd_node_string_view(const SerdNode* SERD_NONNULL node); + +/** @} @defgroup serd_node_operators Operators @{ |