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/96455

Added getUnsignedIntValue().
Added try/catch.
Fixed merge conflict.
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-949111/+merge/96455
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-07 13:11:43 +0000
+++ src/store/naive/atomic_items.cpp	2012-03-07 21:10:24 +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-03-07 13:11:43 +0000
+++ src/store/naive/atomic_items.h	2012-03-07 21:10:24 +0000
@@ -1462,6 +1462,7 @@
 
   xs_long getLongValue() const; 
 
+  xs_unsignedInt getUnsignedIntValue() const;
   xs_nonNegativeInteger getUnsignedIntegerValue() const { return theValue; }
 
   zstring getStringValue() const;

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to