Differences From Artifact [0862e86c30]:
- File src/OFDictionary.m — part of check-in [03963d9304] at 2017-05-14 01:30:20 on branch trunk — macros.h: Add null_unspecified (user: js, size: 16216) [annotate] [blame] [check-ins using]
To Artifact [d620b3bd51]:
- File
src/OFDictionary.m
— part of check-in
[6b77a5dd8b]
at
2017-05-21 21:28:57
on branch trunk
— Prefix private methods with of_ instead of OF_
This matches Apple's style. (user: js, size: 16217) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
32 33 34 35 36 37 38 | #import "OFUndefinedKeyException.h" static struct { Class isa; } placeholder; @interface OFDictionary () | | | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #import "OFUndefinedKeyException.h" static struct { Class isa; } placeholder; @interface OFDictionary () - (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth; @end @interface OFDictionary_placeholder: OFDictionary @end @implementation OFDictionary_placeholder |
︙ | ︙ | |||
612 613 614 615 616 617 618 | objc_autoreleasePoolPop(pool); return [element autorelease]; } - (OFString *)JSONRepresentation { | | | | | | 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 | 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 = [OFMutableString stringWithString: @"{"]; void *pool = objc_autoreleasePoolPush(); OFEnumerator *keyEnumerator = [self keyEnumerator]; OFEnumerator *objectEnumerator = [self objectEnumerator]; size_t i, count = [self count]; id key, object; |
︙ | ︙ | |||
653 654 655 656 657 658 659 | if (![key isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; [JSON appendString: indentation]; [JSON appendString: @"\t"]; [JSON appendString: [key | | | | 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | if (![key isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; [JSON appendString: indentation]; [JSON appendString: @"\t"]; [JSON appendString: [key of_JSONRepresentationWithOptions: identifierOptions depth: depth + 1]]; [JSON appendString: @": "]; [JSON appendString: [object of_JSONRepresentationWithOptions: options depth: depth + 1]]; if (++i < count) [JSON appendString: @",\n"]; else [JSON appendString: @"\n"]; |
︙ | ︙ | |||
681 682 683 684 685 686 687 | int identifierOptions = options | OF_JSON_REPRESENTATION_IDENTIFIER; if (![key isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; [JSON appendString: [key | | | | 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 | int identifierOptions = options | OF_JSON_REPRESENTATION_IDENTIFIER; if (![key isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; [JSON appendString: [key of_JSONRepresentationWithOptions: identifierOptions depth: depth + 1]]; [JSON appendString: @":"]; [JSON appendString: [object of_JSONRepresentationWithOptions: options depth: depth + 1]]; if (++i < count) [JSON appendString: @","]; objc_autoreleasePoolPop(pool2); } |
︙ | ︙ |