Differences From Artifact [5a68687d28]:
- File src/OFURL.m — part of check-in [8aa7f964bc] at 2017-10-28 23:52:32 on branch trunk — OFURL: Return a proper URL for +[fileURLWithPath:] (user: js, size: 10458) [annotate] [blame] [check-ins using]
To Artifact [7016e3a6f1]:
- File
src/OFURL.m
— part of check-in
[b83d1414b1]
at
2017-10-29 00:41:52
on branch trunk
— Fix conversion between URL and path on Win32
This also adds -[OFURL fileSystemRepresentation] to correctly convert a
URL back to a path in the local file system. (user: js, size: 11176) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
478 479 480 481 482 483 484 485 486 487 488 489 490 491 | objc_autoreleasePoolPop(pool); [ret makeImmutable]; return ret; } - (OFString *)description { return [OFString stringWithFormat: @"<%@: %@>", [self class], [self string]]; } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 | objc_autoreleasePoolPop(pool); [ret makeImmutable]; return ret; } - (OFString *)fileSystemRepresentation { void *pool = objc_autoreleasePoolPush(); OFString *path; if (![_scheme isEqual: @"file"]) @throw [OFInvalidArgumentException exception]; if (![_path hasPrefix: @"/"]) @throw [OFInvalidFormatException exception]; path = [[_path copy] autorelease]; if ([path hasSuffix: @"/"]) path = [path substringWithRange: of_range(0, [path length] - 1)]; #ifndef OF_PATH_STARTS_WITH_SLASH path = [path substringWithRange: of_range(1, [path length] - 1)]; #endif #if OF_PATH_DELIMITER != '/' path = [OFString pathWithComponents: [path componentsSeparatedByString: @"/"]]; #endif [path retain]; objc_autoreleasePoolPop(pool); return [path autorelease]; } - (OFString *)description { return [OFString stringWithFormat: @"<%@: %@>", [self class], [self string]]; } |
︙ | ︙ |