Mercurial > projects > dwt-linux
diff dwt/dwthelper/utils.d @ 262:e10de397beb1
ADD version TANGOSVN
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 06 Jul 2008 15:33:12 +0200 |
parents | 5a30aa9820f3 |
children | d472fae79005 |
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d Thu Jul 03 21:20:33 2008 +0200 +++ b/dwt/dwthelper/utils.d Sun Jul 06 15:33:12 2008 +0200 @@ -149,15 +149,30 @@ } public static String toHexString( int i ){ +version(TANGOSVN) + return tango.text.convert.Integer.toString(i, "x" ); +} +else{ return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Hex ); +} } public static String toOctalString( int i ){ +version(TANGOSVN) + return tango.text.convert.Integer.toString(i, "o" ); +} +else{ return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Octal ); +} } public static String toBinaryString( int i ){ +version(TANGOSVN) + return tango.text.convert.Integer.toString(i, "b" ); +} +else{ return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Binary ); +} } public static String toString( int i ){ @@ -635,6 +650,15 @@ public alias tango.stdc.stringz.fromString16z fromString16z; static String toHex(uint value, bool prefix = true, int radix = 8){ +version(TANGOSVN) + return tango.text.convert.Integer.toString( + value, + radix is 10 ? "d" : + radix is 8 ? "o" : + radix is 16 ? "x" : + "d" ); +} +else{ return tango.text.convert.Integer.toString( value, radix is 10 ? tango.text.convert.Integer.Style.Signed : @@ -644,6 +668,7 @@ prefix ? tango.text.convert.Integer.Flags.Prefix : tango.text.convert.Integer.Flags.None ); } +} class RuntimeException : Exception { this( String e = null){