diff options
author | David Robillard <d@drobilla.net> | 2018-12-26 11:54:21 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-08 23:23:05 -0500 |
commit | 8de05b1e2f7849e47c8ac82452a2e038664e510e (patch) | |
tree | 47b39b0e34525538db94b05854f39ad97dad0e92 /src | |
parent | 8975c152774ec7cb7f2ede3b4d08aa58acb512d9 (diff) | |
download | serd-8de05b1e2f7849e47c8ac82452a2e038664e510e.tar.gz serd-8de05b1e2f7849e47c8ac82452a2e038664e510e.tar.bz2 serd-8de05b1e2f7849e47c8ac82452a2e038664e510e.zip |
Add serd_new_boolean()
Diffstat (limited to 'src')
-rw-r--r-- | src/node.c | 8 | ||||
-rw-r--r-- | src/static_nodes.h | 1 |
2 files changed, 9 insertions, 0 deletions
@@ -519,6 +519,14 @@ write_variant_literal(const void* const user_data, } SerdNode* +serd_new_boolean(bool b) +{ + return serd_new_typed_literal(b ? SERD_STATIC_STRING("true") + : SERD_STATIC_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) |