comparison base/src/java/util/ResourceBundle.d @ 54:70388b0e6dad

[swt lin] compiles
author Frank Benoit <benoit@tionex.de>
date Fri, 27 Mar 2009 23:31:11 +0100
parents 1bf55a6eb092
children bbe49769ec18
comparison
equal deleted inserted replaced
53:7e78af7adab5 54:70388b0e6dad
145 map[ key.dup ] = value.dup; 145 map[ key.dup ] = value.dup;
146 } 146 }
147 } 147 }
148 } 148 }
149 149
150 public bool hasString( String key ){ 150 public bool hasString( CString key ){
151 return ( key in map ) !is null; 151 return ( key in map ) !is null;
152 } 152 }
153 153
154 public String getString( String key ){ 154 public String getString( CString key ){
155 if( auto v = key in map ){ 155 if( auto v = key in map ){
156 version(D_Version2){ 156 version(D_Version2){
157 return (*v).idup; 157 return (*v).idup;
158 } else { 158 } else {
159 return (*v).dup; 159 return (*v).dup;
160 } 160 }
161 } 161 }
162 throw new MissingResourceException( "key not found", this.classinfo.name, key ); 162 throw new MissingResourceException( "key not found", this.classinfo.name, key._idup() );
163 } 163 }
164 164
165 public String[] getKeys(){ 165 public String[] getKeys(){
166 return map.keys; 166 return map.keys;
167 } 167 }
170 return new ResourceBundle( data ); 170 return new ResourceBundle( data );
171 } 171 }
172 public static ResourceBundle getBundle( ImportData data ){ 172 public static ResourceBundle getBundle( ImportData data ){
173 return new ResourceBundle( data ); 173 return new ResourceBundle( data );
174 } 174 }
175 public static ResourceBundle getBundle( String name ){ 175 public static ResourceBundle getBundle( CString name ){
176 try{ 176 try{
177 version(Tango){ 177 version(Tango){
178 return new ResourceBundle( cast(String) File.get(name) ); 178 return new ResourceBundle( cast(String) File.get(name) );
179 } else { // Phobos 179 } else { // Phobos
180 implMissing(__FILE__,__LINE__); 180 implMissing(__FILE__,__LINE__);