diff dwt/dwthelper/utils.d @ 332:1ee938a6e02e

Tango updates, removing trace prints and added prints via Logger
author Frank Benoit <benoit@tionex.de>
date Sun, 01 Feb 2009 19:40:09 +0100
parents 0c891bed575f
children f866e80af235
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d	Tue Jan 27 10:40:55 2009 +0100
+++ b/dwt/dwthelper/utils.d	Sun Feb 01 19:40:09 2009 +0100
@@ -21,8 +21,13 @@
 import tango.stdc.stdlib : exit;
 
 import tango.util.log.Trace;
+import tango.util.log.Log;
 import tango.text.UnicodeData;
 
+Logger getDwtLogger(){
+    return Log.lookup( "dwt" );
+}
+
 alias char[] String;
 alias tango.text.Text.Text!(char) StringBuffer;
 
@@ -53,6 +58,11 @@
     public override hash_t toHash(){
         return (typeid(T[])).getHash(&array);
     }
+    static if( is( T == char )){
+        public override char[] toString(){
+            return array;
+        }
+    }
 }
 
 class ValueWrapperT(T) : ValueWrapper {
@@ -476,8 +486,8 @@
     return res.length;
 }
 
-alias tango.text.convert.Utf.toString16 toString16;
-alias tango.text.convert.Utf.toString toString;
+//alias tango.text.convert.Utf.toString16 toString16;
+//alias tango.text.convert.Utf.toString toString;
 
 int toAbsoluteCodePointStartOffset( String str, int index ){
     //Trace.formatln( "str={}, str.length={}, index={}", str, str.length, index );
@@ -1067,7 +1077,7 @@
 void ExceptionPrintStackTrace( Exception e ){
     ExceptionPrintStackTrace( e, Stderr );
 }
-void ExceptionPrintStackTrace( Exception e, Print!(char) print ){
+void ExceptionPrintStackTrace( Exception e, FormatOutput!(char) print ){
     Exception exception = e;
     while( exception !is null ){
         print.formatln( "Exception in {}({}): {}", exception.file, exception.line, exception.msg );