1
2
3
4
5
6
7
8
9
10
11
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
* 2018, 2019, 2020
* Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
<
<
|
|
1
2
3
4
5
6
7
8
9
|
/*
* Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
|
[copy makeImmutable];
return copy;
}
- (void)appendPathComponent: (OFString *)component
{
[self appendPathComponent: component
isDirectory: false];
#ifdef OF_HAVE_FILES
if ([_URLEncodedScheme isEqual: @"file"] &&
![_URLEncodedPath hasSuffix: @"/"] &&
[[OFFileManager defaultManager] directoryExistsAtURL: self]) {
void *pool = objc_autoreleasePoolPush();
OFString *path = [_URLEncodedPath
|
|
<
|
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
|
[copy makeImmutable];
return copy;
}
- (void)appendPathComponent: (OFString *)component
{
[self appendPathComponent: component isDirectory: false];
#ifdef OF_HAVE_FILES
if ([_URLEncodedScheme isEqual: @"file"] &&
![_URLEncodedPath hasSuffix: @"/"] &&
[[OFFileManager defaultManager] directoryExistsAtURL: self]) {
void *pool = objc_autoreleasePoolPush();
OFString *path = [_URLEncodedPath
|
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
|
done = false;
break;
}
}
}
[array insertObject: @""
atIndex: 0];
if (endsWithEmpty)
[array addObject: @""];
path = [array componentsJoinedByString: @"/"];
if (path.length == 0)
path = @"/";
|
|
<
|
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
|
done = false;
break;
}
}
}
[array insertObject: @"" atIndex: 0];
if (endsWithEmpty)
[array addObject: @""];
path = [array componentsJoinedByString: @"/"];
if (path.length == 0)
path = @"/";
|