diff options
author | David Robillard <d@drobilla.net> | 2018-02-04 12:40:45 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-11-25 09:21:03 +0100 |
commit | dbca226473e636e87693db1ccd31095b3d71eb4d (patch) | |
tree | e225c29eac17e1154c7a95c2a78ed3544152ac07 /serd | |
parent | 6d57362026dcd33f6502b968cee57851d16ee665 (diff) | |
download | serd-dbca226473e636e87693db1ccd31095b3d71eb4d.tar.gz serd-dbca226473e636e87693db1ccd31095b3d71eb4d.tar.bz2 serd-dbca226473e636e87693db1ccd31095b3d71eb4d.zip |
Add node accessor API
Diffstat (limited to 'serd')
-rw-r--r-- | serd/serd.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/serd/serd.h b/serd/serd.h index 51b00217..ce890403 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -607,6 +607,34 @@ SerdNode serd_node_new_blob(const void* buf, size_t size, bool wrap_lines); /** + Return the type of a node (SERD_URI, SERD_BLANK, or SERD_LITERAL). +*/ +SERD_API +SerdType +serd_node_get_type(const SerdNode* node); + +/** + Return the string value of a node. +*/ +SERD_API +const char* +serd_node_get_string(const SerdNode* node); + +/** + Return the length of the string value of a node in bytes. +*/ +SERD_API +size_t +serd_node_get_length(const SerdNode* node); + +/** + Return the flags (string properties) of a node. +*/ +SERD_API +SerdNodeFlags +serd_node_get_flags(const SerdNode* node); + +/** Free any data owned by `node`. Note that if `node` is itself dynamically allocated (which is not the case |