Overview
| Comment: | +[stringWithUTF8StringNoCopy:length:freeWhenDone:] |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
1ec122d57cd9ab6bf2ed44c0193c0379 |
| User & Date: | js on 2017-11-04 16:01:51 |
| Other Links: | manifest | tags |
Context
|
2017-11-04
| ||
| 21:09 | OFString: Improve freeWhenDone in case of error (check-in: 9f3a4dfbc0 user: js tags: trunk) | |
| 16:01 | +[stringWithUTF8StringNoCopy:length:freeWhenDone:] (check-in: 1ec122d57c user: js tags: trunk) | |
|
2017-10-31
| ||
| 22:27 | Make +[OFDate distant*] a class property (check-in: bc218f2c07 user: js tags: trunk) | |
Changes
Modified src/OFString.h from [37d4036ea2] to [cf140eeb90].
| ︙ | |||
332 333 334 335 336 337 338 | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | - + + + + + + + + + + + + + + + + + + + | * @return A new autoreleased OFString */ + (instancetype)stringWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength; /*! * @brief Creates a new OFString from a UTF-8 encoded C string without copying |
| ︙ | |||
573 574 575 576 577 578 579 | 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | - + + + + + + + + + + - + + + + + + + + + | * @return An initialized OFString */ - (instancetype)initWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength; /*! * @brief Initializes an already allocated OFString from an UTF-8 encoded C |
| ︙ |
Modified src/OFString.m from [e0c9985c5f] to [00802d6b23].
| ︙ | |||
415 416 417 418 419 420 421 422 423 424 425 426 427 428 | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | + + + + + + + + + + |
- (instancetype)initWithUTF8StringNoCopy: (char *)UTF8String
freeWhenDone: (bool)freeWhenDone
{
return (id)[[OFString_UTF8 alloc]
initWithUTF8StringNoCopy: UTF8String
freeWhenDone: freeWhenDone];
}
- (instancetype)initWithUTF8StringNoCopy: (char *)UTF8String
length: (size_t)UTF8StringLength
freeWhenDone: (bool)freeWhenDone
{
return (id)[[OFString_UTF8 alloc]
initWithUTF8StringNoCopy: UTF8String
length: UTF8StringLength
freeWhenDone: freeWhenDone];
}
- (instancetype)initWithCString: (const char *)cString
encoding: (of_string_encoding_t)encoding
{
if (encoding == OF_STRING_ENCODING_UTF_8) {
id string;
size_t length;
|
| ︙ | |||
654 655 656 657 658 659 660 661 662 663 664 665 666 667 | 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | + + + + + + + + + + |
+ (instancetype)stringWithUTF8StringNoCopy: (char *)UTF8String
freeWhenDone: (bool)freeWhenDone
{
return [[[self alloc]
initWithUTF8StringNoCopy: UTF8String
freeWhenDone: freeWhenDone] autorelease];
}
+ (instancetype)stringWithUTF8StringNoCopy: (char *)UTF8String
length: (size_t)UTF8StringLength
freeWhenDone: (bool)freeWhenDone
{
return [[[self alloc]
initWithUTF8StringNoCopy: UTF8String
length: UTF8StringLength
freeWhenDone: freeWhenDone] autorelease];
}
+ (instancetype)stringWithCString: (const char *)cString
encoding: (of_string_encoding_t)encoding
{
return [[[self alloc] initWithCString: cString
encoding: encoding] autorelease];
}
|
| ︙ | |||
840 841 842 843 844 845 846 847 848 849 850 851 852 853 | 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 | + + + + + + + + |
}
- (instancetype)initWithUTF8StringNoCopy: (char *)UTF8String
freeWhenDone: (bool)freeWhenDone
{
return [self initWithUTF8String: UTF8String];
}
- (instancetype)initWithUTF8StringNoCopy: (char *)UTF8String
length: (size_t)UTF8StringLength
freeWhenDone: (bool)freeWhenDone
{
return [self initWithUTF8String: UTF8String
length: UTF8StringLength];
}
- (instancetype)initWithCString: (const char *)cString
encoding: (of_string_encoding_t)encoding
{
return [self initWithCString: cString
encoding: encoding
length: strlen(cString)];
|
| ︙ |
Modified src/OFString_UTF8.m from [c30817026a] to [542fa51776].
| ︙ | |||
389 390 391 392 393 394 395 396 397 398 | 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | + + + + + + + + + + + - + + + - - - - - |
return self;
}
- (instancetype)initWithUTF8StringNoCopy: (char *)UTF8String
freeWhenDone: (bool)freeWhenDone
{
return [self initWithUTF8StringNoCopy: UTF8String
length: strlen(UTF8String)
freeWhenDone: freeWhenDone];
}
- (instancetype)initWithUTF8StringNoCopy: (char *)UTF8String
length: (size_t)UTF8StringLength
freeWhenDone: (bool)freeWhenDone
{
self = [super init];
@try {
_s = &_storage;
|
| ︙ |