From 7a171498eca31ddedb0de1f372c982eca00d3d50 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 May 2018 18:03:13 +0200 Subject: Set datatypes on integer, decimal, and base64 nodes --- include/serd/serd.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'include/serd') diff --git a/include/serd/serd.h b/include/serd/serd.h index cb65ba14..6b455878 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -557,15 +557,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. @@ -576,10 +584,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 -- cgit v1.2.1