zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #05993
[Merge] lp:~paul-lucas/zorba/bug-949111 into lp:zorba
Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/bug-949111 into lp:zorba.
Requested reviews:
Paul J. Lucas (paul-lucas)
Matthias Brantner (matthias-brantner)
Related bugs:
Bug #949111 in Zorba: "getUnsignedIntValue() not implemented for Integer"
https://bugs.launchpad.net/zorba/+bug/949111
For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/bug-949111/+merge/96392
Added getUnsignedIntValue().
Added try/catch.
--
https://code.launchpad.net/~paul-lucas/zorba/bug-949111/+merge/96392
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/store/naive/atomic_items.cpp'
--- src/store/naive/atomic_items.cpp 2012-03-01 19:53:10 +0000
+++ src/store/naive/atomic_items.cpp 2012-03-07 16:32:22 +0000
@@ -2437,6 +2437,18 @@
}
+xs_unsignedInt IntegerItemImpl::getUnsignedIntValue() const
+{
+ try {
+ return to_xs_unsignedInt(theValue);
+ }
+ catch ( std::range_error const& ) {
+ RAISE_ERROR_NO_LOC(err::FORG0001,
+ ERROR_PARAMS(theValue, ZED(CastFromToFailed_34), "integer", "unsignedInt"));
+ }
+}
+
+
store::Item* IntegerItemImpl::getType() const
{
return GET_STORE().theSchemaTypeNames[store::XS_INTEGER];
=== modified file 'src/store/naive/atomic_items.h'
--- src/store/naive/atomic_items.h 2012-02-29 17:15:09 +0000
+++ src/store/naive/atomic_items.h 2012-03-07 16:32:22 +0000
@@ -1468,6 +1468,7 @@
xs_integer getIntegerValue() const { return theValue; }
xs_long getLongValue() const;
+ xs_unsignedInt getUnsignedIntValue() const;
xs_nonNegativeInteger getUnsignedIntegerValue() const { return theValue; }
zstring getStringValue() const;
Follow ups