Differences From Artifact [f9a79a3ca8]:
- File src/OFString.m — part of check-in [e66defc073] at 2014-01-19 14:17:06 on branch trunk — Add Unicode -> Codepage 437 conversion. (user: js, size: 55055) [annotate] [blame] [check-ins using]
To Artifact [006b401a4b]:
- File
src/OFString.m
— part of check-in
[eaa612ad50]
at
2014-02-08 09:26:40
on branch trunk
— Add -[JSONRepresentationWithOptions:]
This also adds OF_JSON_REPRESENTATION_PRETTY. (user: js, size: 55435) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
69 70 71 72 73 74 75 76 77 78 79 80 81 82 | @interface OFString (OF_PRIVATE_CATEGORY) - (size_t)OF_getCString: (char*)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding lossy: (bool)lossy; - (const char*)OF_cStringWithEncoding: (of_string_encoding_t)encoding lossy: (bool)lossy; @end extern bool of_unicode_to_iso_8859_15(const of_unichar_t*, char*, size_t, bool); extern bool of_unicode_to_windows_1252(const of_unichar_t*, char*, size_t, bool); extern bool of_unicode_to_codepage_437(const of_unichar_t*, char*, size_t, bool); | > > | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | @interface OFString (OF_PRIVATE_CATEGORY) - (size_t)OF_getCString: (char*)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding lossy: (bool)lossy; - (const char*)OF_cStringWithEncoding: (of_string_encoding_t)encoding lossy: (bool)lossy; - (OFString*)OF_JSONRepresentationWithOptions: (int)options depth: (size_t)depth; @end extern bool of_unicode_to_iso_8859_15(const of_unichar_t*, char*, size_t, bool); extern bool of_unicode_to_windows_1252(const of_unichar_t*, char*, size_t, bool); extern bool of_unicode_to_codepage_437(const of_unichar_t*, char*, size_t, bool); |
︙ | ︙ | |||
1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 | objc_autoreleasePoolPop(pool); return [element autorelease]; } - (OFString*)JSONRepresentation { OFMutableString *JSON = [[self mutableCopy] autorelease]; /* FIXME: This is slow! Write it in pure C! */ [JSON replaceOccurrencesOfString: @"\\" withString: @"\\\\"]; [JSON replaceOccurrencesOfString: @"\"" | > > > > > > > > > > > > > | 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 | objc_autoreleasePoolPop(pool); return [element autorelease]; } - (OFString*)JSONRepresentation { return [self OF_JSONRepresentationWithOptions: 0 depth: 0]; } - (OFString*)JSONRepresentationWithOptions: (int)options { return [self OF_JSONRepresentationWithOptions: options depth: 0]; } - (OFString*)OF_JSONRepresentationWithOptions: (int)options depth: (size_t)depth { OFMutableString *JSON = [[self mutableCopy] autorelease]; /* FIXME: This is slow! Write it in pure C! */ [JSON replaceOccurrencesOfString: @"\\" withString: @"\\\\"]; [JSON replaceOccurrencesOfString: @"\"" |
︙ | ︙ |