Changeset 212:ab60f3309436 for dwt/dwthelper/XmlTranscode.d
- Timestamp:
- 05/04/08 18:12:38 (8 months ago)
- Files:
-
- dwt/dwthelper/XmlTranscode.d (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/dwthelper/XmlTranscode.d
r198 r212 10 10 + The given string is modified. 11 11 +/ 12 char[] xmlUnescape( char[]str ){12 String xmlUnescape( String str ){ 13 13 14 14 void error(){ … … 18 18 // Ӓ 19 19 // ኯ 20 char[]src = str;21 char[]trg = str;20 String src = str; 21 String trg = str; 22 22 while( src.length ){ 23 23 if( src[0] !is '&' ){ … … 35 35 if( semi is len ) error(); // no semi found 36 36 37 char[]entityName = src[ 0 .. semi ]; // name without semi37 String entityName = src[ 0 .. semi ]; // name without semi 38 38 dchar entityValue = 0; 39 39 switch( entityName ){ … … 80 80 arr[0] = entityValue; 81 81 uint ate = 0; 82 char[]res = tango.text.convert.Utf.toString( arr, trg, &ate );82 String res = tango.text.convert.Utf.toString( arr, trg, &ate ); 83 83 trg = trg[ res.length .. $ ]; 84 84 src = src[ semi +1 .. $ ]; // go past semi … … 95 95 + If processing is needed, a new string is allocated. 96 96 +/ 97 char[] xmlEscape( char[]xml ){97 String xmlEscape( String xml ){ 98 98 bool needsReplacement( dchar c ){ 99 99 switch( c ){ … … 122 122 123 123 // yes, do a new string, start with +20 chars 124 char[]res = new char[ xml.length + 20 ];124 String res = new char[ xml.length + 20 ]; 125 125 res.length = 0; 126 126
