diff options
author | David Robillard <d@drobilla.net> | 2018-05-12 18:03:13 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 16:27:02 -0500 |
commit | cd89a74a2f7bf8c3efc3ecf1597cf39d6295db00 (patch) | |
tree | 3cc01ec3ac53ea4457d49691198b68581229b773 /include | |
parent | 5c02da92038072f28408854e862fc2d4edf765d4 (diff) | |
download | serd-cd89a74a2f7bf8c3efc3ecf1597cf39d6295db00.tar.gz serd-cd89a74a2f7bf8c3efc3ecf1597cf39d6295db00.tar.bz2 serd-cd89a74a2f7bf8c3efc3ecf1597cf39d6295db00.zip |
Set datatypes on integer, decimal, and base64 nodes
Diffstat (limited to 'include')
-rw-r--r-- | include/serd/node.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/serd/node.h b/include/serd/node.h index cbf5efcc..2f4384bd 100644 --- a/include/serd/node.h +++ b/include/serd/node.h @@ -172,13 +172,21 @@ serd_new_file_uri(SerdStringView path, SerdStringView hostname); @param d The value for the new node. @param frac_digits The maximum number of digits after the decimal place. + @param datatype Datatype of node, or NULL for xsd:decimal. */ SERD_API SerdNode* SERD_ALLOCATED -serd_new_decimal(double d, unsigned frac_digits); +serd_new_decimal(double d, + unsigned frac_digits, + const SerdNode* SERD_NULLABLE datatype); -/// Create a new node by serialising `i` into an xsd:integer string +/** + Create a new node by serialising `i` into an xsd:integer string. + + @param i Integer value to serialise. + @param datatype Datatype of node, or NULL for xsd:integer. +*/ SERD_API SerdNode* SERD_ALLOCATED -serd_new_integer(int64_t i); +serd_new_integer(int64_t i, const SerdNode* SERD_NULLABLE datatype); /** Create a node by serialising `buf` into an xsd:base64Binary string. @@ -189,9 +197,13 @@ serd_new_integer(int64_t i); @param buf Raw binary input data. @param size Size of `buf`. @param wrap_lines Wrap lines at 76 characters to conform to RFC 2045. + @param datatype Datatype of node, or NULL for xsd:base64Binary. */ SERD_API SerdNode* SERD_ALLOCATED -serd_new_blob(const void* SERD_NONNULL buf, size_t size, bool wrap_lines); +serd_new_blob(const void* SERD_NONNULL buf, + size_t size, + bool wrap_lines, + const SerdNode* SERD_NULLABLE datatype); /// Return a deep copy of `node` SERD_API SerdNode* SERD_ALLOCATED |