Differences From Artifact [cd06b3b006]:
- File src/OFStream.m — part of check-in [813c00ccf0] at 2013-01-09 22:24:47 on branch trunk — Update copyright. (user: js, size: 29061) [annotate] [blame] [check-ins using]
To Artifact [c8e036b974]:
- File
src/OFStream.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: 29055) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
769 770 771 772 773 774 775 | encoding: (of_string_encoding_t)encoding { const char *delimiterCString; size_t i, j, delimiterLength, pageSize, bufferLength, retLength; char *retCString, *buffer, *newCache; OFString *ret; | | | | 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | encoding: (of_string_encoding_t)encoding { const char *delimiterCString; size_t i, j, delimiterLength, pageSize, bufferLength, retLength; char *retCString, *buffer, *newCache; OFString *ret; delimiterCString = [delimiter cStringWithEncoding: encoding]; delimiterLength = [delimiter cStringLengthWithEncoding: encoding]; j = 0; if (delimiterLength == 0) @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; |
︙ | ︙ | |||
1374 1375 1376 1377 1378 1379 1380 | return [self writeString: string usingEncoding: OF_STRING_ENCODING_UTF_8]; } - (size_t)writeString: (OFString*)string usingEncoding: (of_string_encoding_t)encoding { | | | | | | 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 | return [self writeString: string usingEncoding: OF_STRING_ENCODING_UTF_8]; } - (size_t)writeString: (OFString*)string usingEncoding: (of_string_encoding_t)encoding { size_t length = [string cStringLengthWithEncoding: encoding]; [self writeBuffer: [string cStringWithEncoding: encoding] length: length]; return length; } - (size_t)writeLine: (OFString*)string { return [self writeLine: string usingEncoding: OF_STRING_ENCODING_UTF_8]; } - (size_t)writeLine: (OFString*)string usingEncoding: (of_string_encoding_t)encoding { size_t stringLength = [string cStringLengthWithEncoding: encoding]; char *buffer; buffer = [self allocMemoryWithSize: stringLength + 1]; @try { memcpy(buffer, [string cStringWithEncoding: encoding], stringLength); buffer[stringLength] = '\n'; [self writeBuffer: buffer length: stringLength + 1]; } @finally { [self freeMemory: buffer]; |
︙ | ︙ |