526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
|
}
- (instancetype)initFileURLWithPath: (OFString *)path
isDirectory: (bool)isDirectory
{
@try {
void *pool = objc_autoreleasePoolPush();
OFURL *currentDirectoryURL;
# if OF_PATH_DELIMITER != '/'
path = [[path pathComponents] componentsJoinedByString: @"/"];
# endif
if (isDirectory && ![path hasSuffix: OF_PATH_DELIMITER_STRING])
path = [path stringByAppendingString: @"/"];
currentDirectoryURL =
[[OFFileManager defaultManager] currentDirectoryURL];
|
>
>
>
>
|
>
>
>
>
>
|
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
|
}
- (instancetype)initFileURLWithPath: (OFString *)path
isDirectory: (bool)isDirectory
{
@try {
void *pool = objc_autoreleasePoolPush();
# if OF_PATH_DELIMITER != '/' || defined(OF_WINDOWS) || defined(OF_DJGPP)
OFArray OF_GENERIC(OFString *) *pathComponents =
[path pathComponents];
# endif
OFURL *currentDirectoryURL;
# if OF_PATH_DELIMITER != '/'
path = [pathComponents componentsJoinedByString: @"/"];
# endif
# if defined(OF_WINDOWS) || defined(OF_DJGPP)
if ([[pathComponents firstObject] hasSuffix: @":"])
path = [path stringByPrependingString: @"/"];
# endif
if (isDirectory && ![path hasSuffix: OF_PATH_DELIMITER_STRING])
path = [path stringByAppendingString: @"/"];
currentDirectoryURL =
[[OFFileManager defaultManager] currentDirectoryURL];
|