# HG changeset patch # User Frank Benoit # Date 1207926955 -7200 # Node ID fef1e3b373788c33ad6aed4500c0a050f415351d # Parent 3d5dbb27dec24debfcec04440309684b59660335 sync with dwt-linux diff -r 3d5dbb27dec2 -r fef1e3b37378 dwt/dwthelper/ResourceBundle.d --- 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 ); diff -r 3d5dbb27dec2 -r fef1e3b37378 dwt/dwthelper/utils.d --- 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{