Mercurial > projects > dwt2
comparison java/src/java/util/ResourceBundle.d @ 18:735224fcc45f
redirected all printings to DwtLogger
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 18 Mar 2009 09:57:53 +0100 |
parents | 712ffca654f3 |
children | 9b96950f2c3c |
comparison
equal
deleted
inserted
replaced
17:6f068362a363 | 18:735224fcc45f |
---|---|
2 * Authors: Frank Benoit <keinfarbton@googlemail.com> | 2 * Authors: Frank Benoit <keinfarbton@googlemail.com> |
3 */ | 3 */ |
4 module java.util.ResourceBundle; | 4 module java.util.ResourceBundle; |
5 | 5 |
6 import tango.text.Util; | 6 import tango.text.Util; |
7 import tango.io.Stdout; | |
8 | 7 |
9 import java.lang.util; | 8 import java.lang.util; |
10 import java.lang.Integer; | 9 import java.lang.Integer; |
11 import java.lang.exceptions; | 10 import java.lang.exceptions; |
12 import java.util.MissingResourceException; | 11 import java.util.MissingResourceException; |
52 } | 51 } |
53 private void initialize( String data ){ | 52 private void initialize( String data ){ |
54 String line; | 53 String line; |
55 int dataIndex; | 54 int dataIndex; |
56 | 55 |
57 //tango.io.Stdout.Stdout.formatln( "properties put ..." ); | |
58 void readLine(){ | 56 void readLine(){ |
59 line.length = 0; | 57 line.length = 0; |
60 char i = data[ dataIndex++ ]; | 58 char i = data[ dataIndex++ ]; |
61 while( dataIndex < data.length && i !is '\n' && i !is '\r' ){ | 59 while( dataIndex < data.length && i !is '\n' && i !is '\r' ){ |
62 line ~= i; | 60 line ~= i; |
63 i = data[ dataIndex++ ]; | 61 i = data[ dataIndex++ ]; |
64 } | 62 } |
65 } | 63 } |
66 | 64 |
67 //tango.io.Stdout.Stdout.formatln( "properties put {}", __LINE__ ); | |
68 bool linecontinue = false; | 65 bool linecontinue = false; |
69 bool iskeypart = true; | 66 bool iskeypart = true; |
70 String key; | 67 String key; |
71 String value; | 68 String value; |
72 nextline: | 69 nextline: |
73 while( dataIndex < data.length ){ | 70 while( dataIndex < data.length ){ |
74 //tango.io.Stdout.Stdout.formatln( "properties put {} startline", __LINE__ ); | |
75 readLine(); | 71 readLine(); |
76 line = java.lang.util.trim(line); | 72 line = java.lang.util.trim(line); |
77 if( line.length is 0 ){ | 73 if( line.length is 0 ){ |
78 //tango.io.Stdout.Stdout.formatln( "properties put {} was 0 length", __LINE__ ); | |
79 continue; | 74 continue; |
80 } | 75 } |
81 if( line[0] == '#' ){ | 76 if( line[0] == '#' ){ |
82 //tango.io.Stdout.Stdout.formatln( "properties put {} was comment", __LINE__ ); | |
83 continue; | 77 continue; |
84 } | 78 } |
85 int pos = 0; | 79 int pos = 0; |
86 bool esc = false; | 80 bool esc = false; |
87 if( !linecontinue ){ | 81 if( !linecontinue ){ |
136 if( iskeypart ){ | 130 if( iskeypart ){ |
137 throw new RuntimeException( __FILE__, __LINE__, "Cannot find = in record" ); | 131 throw new RuntimeException( __FILE__, __LINE__, "Cannot find = in record" ); |
138 } | 132 } |
139 key = java.lang.util.trim(key); | 133 key = java.lang.util.trim(key); |
140 value = java.lang.util.trim(value); | 134 value = java.lang.util.trim(value); |
141 //tango.io.Stdout.Stdout.formatln( "properties put {}=>{}", key, value ); | |
142 | 135 |
143 map[ key.dup ] = value.dup; | 136 map[ key.dup ] = value.dup; |
144 //tango.io.Stdout.Stdout.formatln( "properties put {}", __LINE__ ); | |
145 } | 137 } |
146 } | 138 } |
147 | 139 |
148 public bool hasString( String key ){ | 140 public bool hasString( String key ){ |
149 return ( key in map ) !is null; | 141 return ( key in map ) !is null; |