825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
|
{
return _URLEncodedPath;
}
- (OFArray *)pathComponents
{
void *pool = objc_autoreleasePoolPush();
bool isFile = [_URLEncodedScheme isEqual: @"file"];
OFMutableArray *ret;
size_t count;
if (isFile) {
OFString *path = [_URLEncodedPath
of_URLPathToPathWithURLEncodedHost: nil];
ret = [[path.pathComponents mutableCopy] autorelease];
if (![ret.firstObject isEqual: @"/"])
[ret insertObject: @"/"
atIndex: 0];
} else
ret = [[[_URLEncodedPath componentsSeparatedByString: @"/"]
mutableCopy] autorelease];
count = ret.count;
if (count > 0 && [ret.firstObject length] == 0)
[ret replaceObjectAtIndex: 0
withObject: @"/"];
for (size_t i = 0; i < count; i++) {
OFString *component = [ret objectAtIndex: i];
if (isFile)
component =
[component of_pathComponentToURLPathComponent];
[ret replaceObjectAtIndex: i
withObject: component.stringByURLDecoding];
}
[ret makeImmutable];
[ret retain];
|
>
>
>
>
>
>
|
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
|
{
return _URLEncodedPath;
}
- (OFArray *)pathComponents
{
void *pool = objc_autoreleasePoolPush();
#ifdef OF_HAVE_FILES
bool isFile = [_URLEncodedScheme isEqual: @"file"];
#endif
OFMutableArray *ret;
size_t count;
#ifdef OF_HAVE_FILES
if (isFile) {
OFString *path = [_URLEncodedPath
of_URLPathToPathWithURLEncodedHost: nil];
ret = [[path.pathComponents mutableCopy] autorelease];
if (![ret.firstObject isEqual: @"/"])
[ret insertObject: @"/"
atIndex: 0];
} else
#endif
ret = [[[_URLEncodedPath componentsSeparatedByString: @"/"]
mutableCopy] autorelease];
count = ret.count;
if (count > 0 && [ret.firstObject length] == 0)
[ret replaceObjectAtIndex: 0
withObject: @"/"];
for (size_t i = 0; i < count; i++) {
OFString *component = [ret objectAtIndex: i];
#ifdef OF_HAVE_FILES
if (isFile)
component =
[component of_pathComponentToURLPathComponent];
#endif
[ret replaceObjectAtIndex: i
withObject: component.stringByURLDecoding];
}
[ret makeImmutable];
[ret retain];
|