From fe0b6d5d4d78cb31e1bf2381198890d070e46ed1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 26 Dec 2018 11:54:21 -0500 Subject: Add serd_new_boolean() --- src/node.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/node.c') diff --git a/src/node.c b/src/node.c index 08893fc7..199fbc5e 100644 --- a/src/node.c +++ b/src/node.c @@ -45,6 +45,7 @@ typedef struct StaticNode { {sizeof(NS_XSD #name) - 1, 0, SERD_URI}, NS_XSD #name}; DEFINE_XSD_NODE(base64Binary) +DEFINE_XSD_NODE(boolean) DEFINE_XSD_NODE(decimal) DEFINE_XSD_NODE(integer) @@ -457,6 +458,13 @@ serd_digits(const double abs) return lg < 1.0 ? 1U : (unsigned)lg; } +SerdNode* +serd_new_boolean(bool b) +{ + return serd_new_typed_literal(b ? serd_string("true") : serd_string("false"), + serd_node_string_view(&serd_xsd_boolean.node)); +} + SerdNode* serd_new_decimal(const double d, const unsigned frac_digits, -- cgit v1.2.1