aboutsummaryrefslogtreecommitdiffstats
path: root/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>2018-12-30 17:58:17 -0500
commit2b0e3de607f2b0eca00b3986ecbcd9fe26ecf95d (patch)
treee2574e8e816bcef8fae80538123f3a3b386a30eb /serd/serd.h
parentf539637ea4dc40a8a2552f15092ea3abd69d5343 (diff)
downloadserd-2b0e3de607f2b0eca00b3986ecbcd9fe26ecf95d.tar.gz
serd-2b0e3de607f2b0eca00b3986ecbcd9fe26ecf95d.tar.bz2
serd-2b0e3de607f2b0eca00b3986ecbcd9fe26ecf95d.zip
Set datatypes on integer, decimal, and base64 nodes
Diffstat (limited to 'serd/serd.h')
-rw-r--r--serd/serd.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 79cd53dc..20db1864 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -582,18 +582,27 @@ serd_node_new_relative_uri(const char* str,
represent a double and float, respectively.
@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, may be NULL in which case the node has
+ type xsd:decimal.
*/
SERD_API
SerdNode*
-serd_node_new_decimal(double d, unsigned frac_digits);
+serd_node_new_decimal(double d, unsigned frac_digits, const SerdNode* datatype);
/**
Create a new node by serialising `i` into an xsd:integer string.
+
+ @param i Integer value to serialise.
+
+ @param datatype Datatype of node, may be NULL in which case the node has
+ type xsd:integer.
*/
SERD_API
SerdNode*
-serd_node_new_integer(int64_t i);
+serd_node_new_integer(int64_t i, const SerdNode* datatype);
/**
Create a node by serialising `buf` into an xsd:base64Binary string.
@@ -601,12 +610,19 @@ serd_node_new_integer(int64_t i);
binary data, which can be decoded using serd_base64_decode().
@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, may be NULL in which case the node has
+ type xsd:base64Binary.
*/
SERD_API
-SerdNode*
-serd_node_new_blob(const void* buf, size_t size, bool wrap_lines);
+SerdNode* serd_node_new_blob(const void* buf,
+ size_t size,
+ bool wrap_lines,
+ const SerdNode* datatype);
/**
Return the type of a node (SERD_URI, SERD_BLANK, or SERD_LITERAL).