Differences From Artifact [9234efc5e1]:
- File src/OFString+XMLUnescaping.m — part of check-in [813c00ccf0] at 2013-01-09 22:24:47 on branch trunk — Update copyright. (user: js, size: 6708) [annotate] [blame] [check-ins using]
To Artifact [467acead25]:
- File
src/OFString+XMLUnescaping.m
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 6722) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
82 83 84 85 86 87 88 | } - (OFString*)stringByXMLUnescapingWithDelegate: (id <OFStringXMLUnescapingDelegate>)delegate { const char *string; size_t i, last, length; | | | | | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | } - (OFString*)stringByXMLUnescapingWithDelegate: (id <OFStringXMLUnescapingDelegate>)delegate { const char *string; size_t i, last, length; bool inEntity; OFMutableString *ret; string = [self UTF8String]; length = [self UTF8StringLength]; ret = [OFMutableString string]; last = 0; inEntity = false; for (i = 0; i < length; i++) { if (!inEntity && string[i] == '&') { [ret appendUTF8String: string + last length: i - last]; last = i + 1; inEntity = true; } else if (inEntity && string[i] == ';') { const char *entity = string + last; size_t entityLength = i - last; if (entityLength == 2 && !memcmp(entity, "lt", 2)) [ret appendCString: "<" encoding: OF_STRING_ENCODING_ASCII |
︙ | ︙ | |||
163 164 165 166 167 168 169 | [ret appendString: tmp]; objc_autoreleasePoolPop(pool); } else @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; last = i + 1; | | | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | [ret appendString: tmp]; objc_autoreleasePoolPop(pool); } else @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; last = i + 1; inEntity = false; } } if (inEntity) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; |
︙ | ︙ | |||
185 186 187 188 189 190 191 | #ifdef OF_HAVE_BLOCKS - (OFString*)stringByXMLUnescapingWithBlock: (of_string_xml_unescaping_block_t)block { const char *string; size_t i, last, length; | | | | | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | #ifdef OF_HAVE_BLOCKS - (OFString*)stringByXMLUnescapingWithBlock: (of_string_xml_unescaping_block_t)block { const char *string; size_t i, last, length; bool inEntity; OFMutableString *ret; string = [self UTF8String]; length = [self UTF8StringLength]; ret = [OFMutableString string]; last = 0; inEntity = false; for (i = 0; i < length; i++) { if (!inEntity && string[i] == '&') { [ret appendUTF8String: string + last length: i - last]; last = i + 1; inEntity = true; } else if (inEntity && string[i] == ';') { const char *entity = string + last; size_t entityLength = i - last; if (entityLength == 2 && !memcmp(entity, "lt", 2)) [ret appendCString: "<" encoding: OF_STRING_ENCODING_ASCII |
︙ | ︙ | |||
263 264 265 266 267 268 269 | exceptionWithClass: [self class]]; [ret appendString: tmp]; objc_autoreleasePoolPop(pool); } last = i + 1; | | | 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | exceptionWithClass: [self class]]; [ret appendString: tmp]; objc_autoreleasePoolPop(pool); } last = i + 1; inEntity = false; } } if (inEntity) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; |
︙ | ︙ |