Differences From Artifact [db848cd405]:
- File src/OFString.m — part of check-in [36d0b1e2d8] at 2013-07-29 19:43:06 on branch trunk — Rename OFHTTPRequestReply to OFHTTPResponse. (user: js, size: 55445) [annotate] [blame] [check-ins using]
To Artifact [6989417794]:
- File
src/OFString.m
— part of check-in
[7c4179ab9b]
at
2013-08-14 19:17:10
on branch trunk
— +[stringWithPath:] -> +[pathWithComponents:].
This removes -[initWithPath:,...], so that it's finally possible to use
-[initWithPath:] for many places where a workaround like
-[initWithDirectoryPath:] was required before. (user: js, size: 55019) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
406 407 408 409 410 411 412 | - initWithFormat: (OFConstantString*)format arguments: (va_list)arguments { return (id)[[OFString_UTF8 alloc] initWithFormat: format arguments: arguments]; } | < < < < < < < < < < < < < < < < < < < < | 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | - initWithFormat: (OFConstantString*)format arguments: (va_list)arguments { return (id)[[OFString_UTF8 alloc] initWithFormat: format arguments: arguments]; } - initWithContentsOfFile: (OFString*)path { return (id)[[OFString_UTF8 alloc] initWithContentsOfFile: path]; } - initWithContentsOfFile: (OFString*)path encoding: (of_string_encoding_t)encoding |
︙ | ︙ | |||
617 618 619 620 621 622 623 | ret = [[[self alloc] initWithFormat: format arguments: arguments] autorelease]; va_end(arguments); return ret; } | < < < < < < < < < < < < < | 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | ret = [[[self alloc] initWithFormat: format arguments: arguments] autorelease]; va_end(arguments); return ret; } + (instancetype)stringWithContentsOfFile: (OFString*)path { return [[[self alloc] initWithContentsOfFile: path] autorelease]; } + (instancetype)stringWithContentsOfFile: (OFString*)path encoding: (of_string_encoding_t)encoding |
︙ | ︙ | |||
653 654 655 656 657 658 659 660 661 662 663 664 665 666 | + (instancetype)stringWithContentsOfURL: (OFURL*)URL encoding: (of_string_encoding_t)encoding { return [[[self alloc] initWithContentsOfURL: URL encoding: encoding] autorelease]; } - init { if (object_getClass(self) == [OFString class]) { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { | > > > > > > > > > > > > > > > > > > > | 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | + (instancetype)stringWithContentsOfURL: (OFURL*)URL encoding: (of_string_encoding_t)encoding { return [[[self alloc] initWithContentsOfURL: URL encoding: encoding] autorelease]; } + (instancetype)pathWithComponents: (OFArray*)components { OFMutableString *ret = [OFMutableString string]; void *pool = objc_autoreleasePoolPush(); OFEnumerator *enumerator = [components objectEnumerator]; OFString *component; if ((component = [enumerator nextObject]) != nil) [ret appendString: component]; while ((component = [enumerator nextObject]) != nil) { [ret appendString: OF_PATH_DELIMITER_STRING]; [ret appendString: component]; } objc_autoreleasePoolPop(pool); return ret; } - init { if (object_getClass(self) == [OFString class]) { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { |
︙ | ︙ | |||
828 829 830 831 832 833 834 | return ret; } - initWithFormat: (OFConstantString*)format arguments: (va_list)arguments { | < < < < < < < < < < < < < < < < < < < < < < < < < < | 814 815 816 817 818 819 820 821 822 823 824 825 826 827 | return ret; } - initWithFormat: (OFConstantString*)format arguments: (va_list)arguments { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @throw e; } |
︙ | ︙ | |||
1805 1806 1807 1808 1809 1810 1811 | [new makeImmutable]; return new; } - (OFString*)stringByAppendingPathComponent: (OFString*)component { | > > > > | > > > > | 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 | [new makeImmutable]; return new; } - (OFString*)stringByAppendingPathComponent: (OFString*)component { void *pool = objc_autoreleasePoolPush(); OFString *ret; ret = [OFString pathWithComponents: [OFArray arrayWithObjects: self, component, nil]]; [ret retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } - (OFString*)stringByPrependingString: (OFString*)string { OFMutableString *new = [[string mutableCopy] autorelease]; [new appendString: self]; |
︙ | ︙ |