diff options
author | David Robillard <d@drobilla.net> | 2018-12-26 11:54:21 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-13 23:03:43 -0500 |
commit | 2ddf10fb8bfabff3ecdbe9ea866a905631ec2866 (patch) | |
tree | 112a6068678ec9696d1ede59db0e461d920ca4ab /src | |
parent | c90c662f85ca1a36794a0404b2101a72de020ca3 (diff) | |
download | serd-2ddf10fb8bfabff3ecdbe9ea866a905631ec2866.tar.gz serd-2ddf10fb8bfabff3ecdbe9ea866a905631ec2866.tar.bz2 serd-2ddf10fb8bfabff3ecdbe9ea866a905631ec2866.zip |
Add serd_new_boolean()
Diffstat (limited to 'src')
-rw-r--r-- | src/node.c | 7 | ||||
-rw-r--r-- | src/static_nodes.h | 1 |
2 files changed, 8 insertions, 0 deletions
@@ -515,6 +515,13 @@ serd_new_custom_literal(const void* const user_data, } 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 SerdNode* const datatype) { // Use given datatype, or xsd:decimal as a default if it is null diff --git a/src/static_nodes.h b/src/static_nodes.h index 18950444..952c0634 100644 --- a/src/static_nodes.h +++ b/src/static_nodes.h @@ -32,6 +32,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) |