changeset 292:708cbfe418e7

sync with dwt-linux
author Frank Benoit <benoit@tionex.de>
date Thu, 21 Aug 2008 17:33:44 +0200
parents 9b075603b4fc
children 810b16d6559b
files dwt/dwthelper/utils.d
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d	Thu Aug 21 16:22:18 2008 +0200
+++ b/dwt/dwthelper/utils.d	Thu Aug 21 17:33:44 2008 +0200
@@ -197,7 +197,7 @@
 
     public static int parseInt( String s, int radix ){
         try{
-            return tango.text.convert.Integer.parse( s, cast(uint)radix );
+            return tango.text.convert.Integer.toLong( s, radix );
         }
         catch( IllegalArgumentException e ){
             throw new NumberFormatException( e );
@@ -206,7 +206,7 @@
 
     public static int parseInt( String s ){
         try{
-            return tango.text.convert.Integer.parse( s );
+            return tango.text.convert.Integer.toLong( s );
         }
         catch( IllegalArgumentException e ){
             throw new NumberFormatException( e );
@@ -372,6 +372,10 @@
     }
     return res;
 }
+
+/++
+ +
+ +/
 int indexToCodepointIndex( String str, int index ){
     if( index < 0 ) return index;
     int i = 0;
@@ -397,6 +401,9 @@
     return res;
 }
 
+/++
+ + Get that String, that contains the next codepoint of a String.
+ +/
 String firstCodePointStr( String str, out int consumed ){
     dchar[1] buf;
     uint ate;
@@ -405,6 +412,12 @@
     return str[ 0 .. ate ];
 }
 
+/++
+ + Get first codepoint of a String. If an offset is needed, simply use a slice:
+ + ---
+ + dchar res = str[ offset .. $ ].firstCodePoint();
+ + ---
+ +/
 dchar firstCodePoint( String str ){
     int dummy;
     return firstCodePoint( str, dummy );