summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-03-07 03:39:02 +0000
committerDavid Robillard <d@drobilla.net>2011-03-07 03:39:02 +0000
commitdc07e86bc7416e494401d242db91a85ca0a84526 (patch)
treef189b160f0a7d2bd186447dd0caad842e776edaa
parent711b26e71b0dcc160616fa015793a0e57acc8a8c (diff)
downloadlilv-dc07e86bc7416e494401d242db91a85ca0a84526.tar.gz
lilv-dc07e86bc7416e494401d242db91a85ca0a84526.tar.bz2
lilv-dc07e86bc7416e494401d242db91a85ca0a84526.zip
Suppose xsd:double numeric literals.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@3045 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/slv2_internal.h1
-rw-r--r--src/value.c3
-rw-r--r--src/world.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/slv2_internal.h b/src/slv2_internal.h
index 7e3693a..9f6638c 100644
--- a/src/slv2_internal.h
+++ b/src/slv2_internal.h
@@ -224,6 +224,7 @@ struct _SLV2World {
SLV2Node slv2_dmanifest_node;
SLV2Node xsd_boolean_node;
SLV2Node xsd_decimal_node;
+ SLV2Node xsd_double_node;
SLV2Node xsd_integer_node;
SLV2Value doap_name_val;
SLV2Value lv2_name_val;
diff --git a/src/value.c b/src/value.c
index 104c977..b37050d 100644
--- a/src/value.c
+++ b/src/value.c
@@ -119,7 +119,8 @@ slv2_value_new_from_node(SLV2World world, SordNode node)
if (datatype_uri) {
if (sord_node_equals(datatype_uri, world->xsd_boolean_node))
type = SLV2_VALUE_BOOL;
- else if (sord_node_equals(datatype_uri, world->xsd_decimal_node))
+ else if (sord_node_equals(datatype_uri, world->xsd_decimal_node)
+ || sord_node_equals(datatype_uri, world->xsd_double_node))
type = SLV2_VALUE_FLOAT;
else if (sord_node_equals(datatype_uri, world->xsd_integer_node))
type = SLV2_VALUE_INT;
diff --git a/src/world.c b/src/world.c
index cc4641b..bc81319 100644
--- a/src/world.c
+++ b/src/world.c
@@ -92,6 +92,7 @@ slv2_world_new()
world->slv2_dmanifest_node = NEW_URI(SLV2_NS_SLV2 "dynamic-manifest");
world->xsd_boolean_node = NEW_URI(SLV2_NS_XSD "boolean");
world->xsd_decimal_node = NEW_URI(SLV2_NS_XSD "decimal");
+ world->xsd_double_node = NEW_URI(SLV2_NS_XSD "double");
world->xsd_integer_node = NEW_URI(SLV2_NS_XSD "integer");
world->doap_name_val = NEW_URI_VAL(SLV2_NS_DOAP "name");
@@ -148,6 +149,7 @@ slv2_world_free(SLV2World world)
slv2_node_free(world->slv2_dmanifest_node);
slv2_node_free(world->xsd_boolean_node);
slv2_node_free(world->xsd_decimal_node);
+ slv2_node_free(world->xsd_double_node);
slv2_node_free(world->xsd_integer_node);
slv2_value_free(world->doap_name_val);