diff dwt/dwthelper/ResourceBundle.d @ 219:9b4e6fc63930

utils updates
author Frank Benoit <benoit@tionex.de>
date Sun, 06 Apr 2008 22:26:22 +0200
parents a481ab32da3d
children 6da025bf255e
line wrap: on
line diff
--- a/dwt/dwthelper/ResourceBundle.d	Sun Apr 06 22:25:15 2008 +0200
+++ b/dwt/dwthelper/ResourceBundle.d	Sun Apr 06 22:26:22 2008 +0200
@@ -7,6 +7,7 @@
 import tango.io.Stdout;
 
 import dwt.DWT;
+import dwt.dwthelper.utils;
 
 class ResourceBundle {
 
@@ -35,7 +36,7 @@
         while( dataIndex < data.length ){
             //tango.io.Stdout.Stdout.formatln( "properties put {} startline", __LINE__ );
             readLine();
-            line = line.trim();
+            line = dwt.dwthelper.utils.trim(line);
             if( line.length is 0 ){
                 //tango.io.Stdout.Stdout.formatln( "properties put {} was 0 length", __LINE__ );
                 continue;
@@ -95,8 +96,8 @@
                 DWT.error( __FILE__, __LINE__, DWT.ERROR_INVALID_ARGUMENT );
                 continue;
             }
-            key = key.trim();
-            value = value.trim();
+            key = dwt.dwthelper.utils.trim(key);
+            value = dwt.dwthelper.utils.trim(value);
             //tango.io.Stdout.Stdout.formatln( "properties put {}=>{}", key, value );
 
             map[ key.dup ] = value.dup;
@@ -112,7 +113,11 @@
         if( auto v = key in map ){
             return (*v).dup;
         }
-        return key;
+        throw new MissingResourceException( "key not found", this.classinfo.name, key );
+    }
+
+    public char[][] getKeys(){
+        return map.keys;
     }
 
     public static ResourceBundle getBundle( char[] name ){