Overview
Comment: | +[stringWithPath:] -> +[pathWithComponents:].
This removes -[initWithPath:,...], so that it's finally possible to use |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
7c4179ab9b6d6c956fe921b0b79ccb46 |
User & Date: | js on 2013-08-14 19:17:10 |
Other Links: | manifest | tags |
Context
2013-08-14
| ||
19:28 | Rename -[initWith*Path:] to -[initWithPath:]. check-in: 0abd116830 user: js tags: trunk | |
19:17 | +[stringWithPath:] -> +[pathWithComponents:]. check-in: 7c4179ab9b user: js tags: trunk | |
13:18 | OFZIPArchive: Make meta data of files available. check-in: 2168071f36 user: js tags: trunk | |
Changes
Modified src/OFFile.m from [f060fd2dab] to [e0f0d0594a].
︙ | |||
276 277 278 279 280 281 282 | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | - - + + | pathComponents = [path pathComponents]; enumerator = [pathComponents objectEnumerator]; while ((component = [enumerator nextObject]) != nil) { void *pool2 = objc_autoreleasePoolPush(); if (currentPath != nil) |
︙ | |||
521 522 523 524 525 526 527 | 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 | + - - + + - | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { OFArray *components = [OFArray arrayWithObjects: |
︙ | |||
579 580 581 582 583 584 585 | 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | + - - + + - | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { OFArray *components = [OFArray arrayWithObjects: |
︙ | |||
623 624 625 626 627 628 629 | 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | + - - + + - | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { OFArray *components = [OFArray arrayWithObjects: |
︙ | |||
650 651 652 653 654 655 656 | 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 | + - - + + - | if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); if ([self directoryExistsAtPath: destination]) { OFArray *components = [OFArray arrayWithObjects: |
︙ |
Modified src/OFMutableString.m from [8d0822912d] to [ad91789f29].
︙ | |||
167 168 169 170 171 172 173 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | - - - - - - - - - - - - - - - - - - - - | - initWithFormat: (OFConstantString*)format arguments: (va_list)arguments { return (id)[[OFMutableString_UTF8 alloc] initWithFormat: format arguments: arguments]; } |
︙ |
Modified src/OFString.h from [5f3de292e6] to [f3d3ca44b0].
︙ | |||
268 269 270 271 272 273 274 | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | - - - - - - - - | * specifier for objects. * * @param format A string used as format to initialize the OFString * @return A new autoreleased OFString */ + (instancetype)stringWithFormat: (OFConstantString*)format, ...; |
︙ | |||
321 322 323 324 325 326 327 328 329 330 331 332 333 334 | 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | + + + + + + + + | * @param URL The URL to the contents for the string * @param encoding The encoding to assume * @return A new autoreleased OFString */ + (instancetype)stringWithContentsOfURL: (OFURL*)URL encoding: (of_string_encoding_t)encoding; /*! * @brief Creates a path from the specified path components. * * @param components An array of components for the path * @return A new autoreleased OFString */ + (instancetype)pathWithComponents: (OFArray*)components; /*! * @brief Initializes an already allocated OFString from a UTF-8 encoded C * string. * * @param UTF8String A UTF-8 encoded C string to initialize the OFString with * @return An initialized OFString */ |
︙ | |||
510 511 512 513 514 515 516 | 510 511 512 513 514 515 516 517 518 519 520 521 522 523 | - - - - - - - - - - - - - - - - - - - - | * @param format A string used as format to initialize the OFString * @param arguments The arguments used in the format string * @return An initialized OFString */ - initWithFormat: (OFConstantString*)format arguments: (va_list)arguments; |
︙ |
Modified src/OFString.m from [db848cd405] to [6989417794].
︙ | |||
406 407 408 409 410 411 412 | 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]; } |
︙ | |||
617 618 619 620 621 622 623 | 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; } |
︙ | |||
653 654 655 656 657 658 659 660 661 662 663 664 665 666 | 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 | 814 815 816 817 818 819 820 821 822 823 824 825 826 827 | - - - - - - - - - - - - - - - - - - - - - - - - - - | return ret; } - initWithFormat: (OFConstantString*)format arguments: (va_list)arguments { |
︙ | |||
1805 1806 1807 1808 1809 1810 1811 | 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: |
︙ |
Modified src/OFString_UTF8.m from [9860c5f0d1] to [dcb1103ce6].
︙ | |||
651 652 653 654 655 656 657 | 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | free(tmp); } } @catch (id e) { [self release]; @throw e; } |
︙ |
Modified tests/OFStringTests.m from [fbc369ef09] to [a5ba78df50].
︙ | |||
278 279 280 281 282 283 284 | 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | - - + + + - + + | componentsSeparatedByString: @"XX" options: OF_STRING_SKIP_EMPTY]) && [a count] == 3 && [[a objectAtIndex: i++] isEqual: @"foo"] && [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @"baz"]) |
︙ |