diff dwt/dwthelper/utils.d @ 37:642f460a0908

Fixed a lot of compile errors, a "hello world" app compiles now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Fri, 10 Oct 2008 12:29:48 +0200
parents db5a898b2119
children 198549365851
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d	Tue Oct 07 12:56:18 2008 +0200
+++ b/dwt/dwthelper/utils.d	Fri Oct 10 12:29:48 2008 +0200
@@ -155,15 +155,15 @@
     }
 
     public static String toHexString( int i ){
-        return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Hex );
+        return tango.text.convert.Integer.toString(i, "x" );
     }
 
     public static String toOctalString( int i ){
-        return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Octal );
+        return tango.text.convert.Integer.toString(i, "o" );
     }
 
     public static String toBinaryString( int i ){
-        return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Binary );
+        return tango.text.convert.Integer.toString(i, "b" );
     }
 
     public static String toString( int i ){
@@ -664,15 +664,18 @@
     }
 }
 
+public String fromStringz (char* str)
+{
+    return tango.stdc.stringz.fromStringz(str);
+}
+
 static String toHex(uint value, bool prefix = true, int radix = 8){
     return tango.text.convert.Integer.toString(
-            value,
-            radix is 10 ? tango.text.convert.Integer.Style.Signed :
-            radix is  8 ? tango.text.convert.Integer.Style.Octal  :
-            radix is 16 ? tango.text.convert.Integer.Style.Hex    :
-                          tango.text.convert.Integer.Style.Signed,
-            prefix ? tango.text.convert.Integer.Flags.Prefix : tango.text.convert.Integer.Flags.None
-            );
+           value,
+           radix is 10 ? "d" :
+           radix is  8 ? "o" :
+           radix is 16 ? "x" :
+           "d" );
 }
 
 class RuntimeException : Exception {