aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd/serd.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-05-12 18:03:13 +0200
committerDavid Robillard <d@drobilla.net>2021-03-07 15:32:24 -0500
commitd4ae57afbd7da668dbf89f7b7e66e2f064437a98 (patch)
treeed521f64a0e844ce9fbd0cd7794739a6f292d766 /include/serd/serd.h
parent471ef4960aba6b5e1c9445229cddc0b3eb9ca148 (diff)
downloadserd-d4ae57afbd7da668dbf89f7b7e66e2f064437a98.tar.gz
serd-d4ae57afbd7da668dbf89f7b7e66e2f064437a98.tar.bz2
serd-d4ae57afbd7da668dbf89f7b7e66e2f064437a98.zip
Set datatypes on integer, decimal, and base64 nodes
Diffstat (limited to 'include/serd/serd.h')
-rw-r--r--include/serd/serd.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 604b8032..c2c9d52d 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -561,15 +561,23 @@ 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
@@ -580,10 +588,14 @@ 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