changeset 200:fef1e3b37378

sync with dwt-linux
author Frank Benoit <benoit@tionex.de>
date Fri, 11 Apr 2008 17:15:55 +0200
parents 3d5dbb27dec2
children 6293c40673a4
files dwt/dwthelper/ResourceBundle.d dwt/dwthelper/utils.d
diffstat 2 files changed, 24 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/dwthelper/ResourceBundle.d	Fri Apr 11 01:26:13 2008 +0200
+++ b/dwt/dwthelper/ResourceBundle.d	Fri Apr 11 17:15:55 2008 +0200
@@ -8,6 +8,7 @@
 
 import dwt.DWT;
 import dwt.dwthelper.utils;
+import tango.io.File;
 
 class ResourceBundle {
 
@@ -60,10 +61,11 @@
                 if( esc ){
                     esc = false;
                     switch( c ){
-                    case 't': c = '\t'; break;
-                    case 'n': c = '\n'; break;
+                    case 't' : c = '\t'; break;
+                    case 'n' : c = '\n'; break;
                     case '\\': c = '\\'; break;
                     case '\"': c = '\"'; break;
+                    //case ':' : c = ':' ; break;
                     default: break;
                     }
                 }
@@ -120,8 +122,18 @@
         return map.keys;
     }
 
+    public static ResourceBundle getBundle( ImportData data ){
+        return new ResourceBundle( cast(char[]) data.data );
+    }
     public static ResourceBundle getBundle( char[] name ){
-        return new ResourceBundle( null );
+        try{
+            scope f = new File(name);
+            return new ResourceBundle( cast(char[]) f.read() );
+        }
+        catch( IOException e){
+            e.msg ~= " file:" ~ name;
+            throw e;
+        }
     }
     public static ResourceBundle getBundleFromData( char[] data ){
         return new ResourceBundle( data );
--- a/dwt/dwthelper/utils.d	Fri Apr 11 01:26:13 2008 +0200
+++ b/dwt/dwthelper/utils.d	Fri Apr 11 17:15:55 2008 +0200
@@ -72,6 +72,11 @@
 class Boolean : ValueWrapperT!(bool) {
     public static Boolean TRUE;
     public static Boolean FALSE;
+
+    static this(){
+        TRUE  = new Boolean(true);
+        FALSE = new Boolean(false);
+    }
     public this( bool v ){
         super(v);
     }
@@ -125,8 +130,7 @@
     }
 
     public this ( char[] s ){
-            implMissing( __FILE__, __LINE__ );
-            super(0);
+        super(parseInt(s));
     }
 
     public static char[] toString( int i, int radix ){
@@ -185,13 +189,11 @@
     }
 
     public static Integer valueOf( char[] s ){
-        implMissing( __FILE__, __LINE__ );
-        return null;
+        return valueOf( parseInt(s));
     }
 
     public static Integer valueOf( int i ){
-        implMissing( __FILE__, __LINE__ );
-        return null;
+        return new Integer(i);
     }
 
     public byte byteValue(){
@@ -861,6 +863,7 @@
             }
         }
     }
+    return true;
 }
 
 class Arrays{