Differences From Artifact [c0e1b1f89f]:
- File src/OFDataArray.m — part of check-in [813c00ccf0] at 2013-01-09 22:24:47 on branch trunk — Update copyright. (user: js, size: 14787) [annotate] [blame] [check-ins using]
To Artifact [bc01872668]:
- File
src/OFDataArray.m
— part of check-in
[9ddd33a258]
at
2013-01-12 17:29:24
on branch trunk
— Rename *UsingEncoding: to *WithEncoding:.
This reverts 5362941.
Even though *UsingEncoding: is what Foundation uses, *WithEncoding: is
more natural and is more consistent with the rest. Also, this means this
restores it to the API of 0.7. (user: js, size: 14781) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
178 179 180 181 182 183 184 | @try { const char *cString; size_t i; itemSize = 1; count = [string | | | | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | @try { const char *cString; size_t i; itemSize = 1; count = [string cStringLengthWithEncoding: OF_STRING_ENCODING_ASCII]; if (count & 1) @throw [OFInvalidFormatException exceptionWithClass: [self class]]; count >>= 1; cString = [string cStringWithEncoding: OF_STRING_ENCODING_ASCII]; items = [self allocMemoryWithSize: count]; for (i = 0; i < count; i++) { uint8_t c1 = cString[2 * i]; uint8_t c2 = cString[2 * i + 1]; uint8_t byte; |
︙ | ︙ | |||
231 232 233 234 235 236 237 | - initWithBase64EncodedString: (OFString*)string { self = [super init]; @try { itemSize = 1; | | | | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | - initWithBase64EncodedString: (OFString*)string { self = [super init]; @try { itemSize = 1; if (!of_base64_decode(self, [string cStringWithEncoding: OF_STRING_ENCODING_ASCII], [string cStringLengthWithEncoding: OF_STRING_ENCODING_ASCII])) { Class c = [self class]; [self release]; @throw [OFInvalidFormatException exceptionWithClass: c]; } } @catch (id e) { [self release]; @throw e; |
︙ | ︙ | |||
265 266 267 268 269 270 271 | @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; stringValue = [element stringValue]; if (!of_base64_decode(self, [stringValue | | | | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; stringValue = [element stringValue]; if (!of_base64_decode(self, [stringValue cStringWithEncoding: OF_STRING_ENCODING_ASCII], [stringValue cStringLengthWithEncoding: OF_STRING_ENCODING_ASCII])) @throw [OFInvalidFormatException exceptionWithClass: [self class]]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; |
︙ | ︙ |