@@ -17,10 +17,11 @@ #include "config.h" #import "OFString+PathAdditions.h" #import "OFArray.h" +#import "OFFileURLHandler.h" #import "OFOutOfRangeException.h" int _OFString_PathAdditions_reference; @@ -314,6 +315,32 @@ [ret makeImmutable]; return ret; } } + +- (bool)of_isDirectoryPath +{ + return ([self hasSuffix: @"/"] || + [OFFileURLHandler of_directoryExistsAtPath: self]); +} + +- (OFString *)of_pathToURLPathWithURLEncodedHost: (OFString **)URLEncodedHost +{ + return self; +} + +- (OFString *)of_URLPathToPathWithURLEncodedHost: (OFString *)URLEncodedHost +{ + OFString *path = self; + + if (path.length > 1 && [path hasSuffix: @"/"]) + path = [path substringWithRange: of_range(0, path.length - 1)]; + + return path; +} + +- (OFString *)of_pathComponentToURLPathComponent +{ + return self; +} @end