diff options
author | David Robillard <d@drobilla.net> | 2018-02-04 12:40:45 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 16:27:02 -0500 |
commit | b0d4ae792c88cc55f9cc9a579530a1a13a158fda (patch) | |
tree | 06f1929415ae2d24d95fe6b1ccdc668e4b19f5a3 /include | |
parent | 4401b2bbcda598599469722d7288bc36e389e356 (diff) | |
download | serd-b0d4ae792c88cc55f9cc9a579530a1a13a158fda.tar.gz serd-b0d4ae792c88cc55f9cc9a579530a1a13a158fda.tar.bz2 serd-b0d4ae792c88cc55f9cc9a579530a1a13a158fda.zip |
Add node accessor API
Diffstat (limited to 'include')
-rw-r--r-- | include/serd/node.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/serd/node.h b/include/serd/node.h index 91550312..73be120e 100644 --- a/include/serd/node.h +++ b/include/serd/node.h @@ -223,6 +223,26 @@ serd_new_blob(const void* SERD_NONNULL buf, size_t size, bool wrap_lines); SERD_API SerdNode serd_node_copy(const SerdNode* SERD_NULLABLE node); +/// Return the type of a node +SERD_PURE_API +SerdNodeType +serd_node_type(const SerdNode* SERD_NONNULL node); + +/// Return the length of a node's string in bytes, excluding the terminator +SERD_PURE_API +size_t +serd_node_length(const SerdNode* SERD_NONNULL node); + +/// Return the additional flags of a node +SERD_PURE_API +SerdNodeFlags +serd_node_flags(const SerdNode* SERD_NONNULL node); + +/// Return the string contents of a node +SERD_PURE_API +const char* SERD_NONNULL +serd_node_string(const SerdNode* SERD_NONNULL node); + /// Return true iff `a` is equal to `b` SERD_PURE_API bool |