@@ -26,11 +26,11 @@ #import "OFString.h" #import "OFXMLElement.h" #ifdef OF_HAVE_FILES # import "OFFileManager.h" -# import "OFURLHandler_file.h" +# import "OFFileURLHandler.h" #endif #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfMemoryException.h" @@ -38,28 +38,27 @@ static OFCharacterSet *URLAllowedCharacterSet = nil; static OFCharacterSet *URLSchemeAllowedCharacterSet = nil; static OFCharacterSet *URLPathAllowedCharacterSet = nil; static OFCharacterSet *URLQueryOrFragmentAllowedCharacterSet = nil; -@interface OFCharacterSet_URLAllowedBase: OFCharacterSet +@interface OFURLAllowedCharacterSetBase: OFCharacterSet - (instancetype)of_init OF_METHOD_FAMILY(init); @end -@interface OFCharacterSet_URLAllowed: OFCharacterSet_URLAllowedBase +@interface OFURLAllowedCharacterSet: OFURLAllowedCharacterSetBase + (OFCharacterSet *)URLAllowedCharacterSet; @end -@interface OFCharacterSet_URLSchemeAllowed: OFCharacterSet_URLAllowedBase +@interface OFURLSchemeAllowedCharacterSet: OFURLAllowedCharacterSetBase + (OFCharacterSet *)URLSchemeAllowedCharacterSet; @end -@interface OFCharacterSet_URLPathAllowed: OFCharacterSet_URLAllowedBase +@interface OFURLPathAllowedCharacterSet: OFURLAllowedCharacterSetBase + (OFCharacterSet *)URLPathAllowedCharacterSet; @end -@interface OFCharacterSet_URLQueryOrFragmentAllowed: - OFCharacterSet_URLAllowedBase +@interface OFURLQueryOrFragmentAllowedCharacterSet: OFURLAllowedCharacterSetBase + (OFCharacterSet *)URLQueryOrFragmentAllowedCharacterSet; @end #ifdef OF_HAVE_FILES static OFString * @@ -138,21 +137,21 @@ return path; # endif } #endif -@interface OFCharacterSet_invertedSetWithPercent: OFCharacterSet +@interface OFInvertedCharacterSetWithoutPercent: OFCharacterSet { OFCharacterSet *_characterSet; bool (*_characterIsMember)(id, SEL, of_unichar_t); } - (instancetype)of_initWithCharacterSet: (OFCharacterSet *)characterSet OF_METHOD_FAMILY(init); @end -@implementation OFCharacterSet_URLAllowedBase +@implementation OFURLAllowedCharacterSetBase - (instancetype)init { OF_INVALID_INIT_METHOD } @@ -179,17 +178,17 @@ { return OF_RETAIN_COUNT_MAX; } @end -@implementation OFCharacterSet_URLAllowed +@implementation OFURLAllowedCharacterSet + (void)initialize { - if (self != [OFCharacterSet_URLAllowed class]) + if (self != [OFURLAllowedCharacterSet class]) return; - URLAllowedCharacterSet = [[OFCharacterSet_URLAllowed alloc] of_init]; + URLAllowedCharacterSet = [[OFURLAllowedCharacterSet alloc] of_init]; } + (OFCharacterSet *)URLAllowedCharacterSet { return URLAllowedCharacterSet; @@ -221,18 +220,18 @@ return false; } } @end -@implementation OFCharacterSet_URLSchemeAllowed +@implementation OFURLSchemeAllowedCharacterSet + (void)initialize { - if (self != [OFCharacterSet_URLSchemeAllowed class]) + if (self != [OFURLSchemeAllowedCharacterSet class]) return; URLSchemeAllowedCharacterSet = - [[OFCharacterSet_URLSchemeAllowed alloc] of_init]; + [[OFURLSchemeAllowedCharacterSet alloc] of_init]; } + (OFCharacterSet *)URLSchemeAllowedCharacterSet { return URLSchemeAllowedCharacterSet; @@ -252,18 +251,18 @@ return false; } } @end -@implementation OFCharacterSet_URLPathAllowed +@implementation OFURLPathAllowedCharacterSet + (void)initialize { - if (self != [OFCharacterSet_URLPathAllowed class]) + if (self != [OFURLPathAllowedCharacterSet class]) return; URLPathAllowedCharacterSet = - [[OFCharacterSet_URLPathAllowed alloc] of_init]; + [[OFURLPathAllowedCharacterSet alloc] of_init]; } + (OFCharacterSet *)URLPathAllowedCharacterSet { return URLPathAllowedCharacterSet; @@ -298,18 +297,18 @@ return false; } } @end -@implementation OFCharacterSet_URLQueryOrFragmentAllowed +@implementation OFURLQueryOrFragmentAllowedCharacterSet + (void)initialize { - if (self != [OFCharacterSet_URLQueryOrFragmentAllowed class]) + if (self != [OFURLQueryOrFragmentAllowedCharacterSet class]) return; URLQueryOrFragmentAllowedCharacterSet = - [[OFCharacterSet_URLQueryOrFragmentAllowed alloc] of_init]; + [[OFURLQueryOrFragmentAllowedCharacterSet alloc] of_init]; } + (OFCharacterSet *)URLQueryOrFragmentAllowedCharacterSet { return URLQueryOrFragmentAllowedCharacterSet; @@ -345,11 +344,11 @@ return false; } } @end -@implementation OFCharacterSet_invertedSetWithPercent +@implementation OFInvertedCharacterSetWithoutPercent - (instancetype)init { OF_INVALID_INIT_METHOD } @@ -381,11 +380,11 @@ void of_url_verify_escaped(OFString *string, OFCharacterSet *characterSet) { void *pool = objc_autoreleasePoolPush(); - characterSet = [[[OFCharacterSet_invertedSetWithPercent alloc] + characterSet = [[[OFInvertedCharacterSetWithoutPercent alloc] of_initWithCharacterSet: characterSet] autorelease]; if ([string indexOfCharacterFromSet: characterSet] != OF_NOT_FOUND) @throw [OFInvalidFormatException exception]; @@ -393,42 +392,42 @@ } @implementation OFCharacterSet (URLCharacterSets) + (OFCharacterSet *)URLSchemeAllowedCharacterSet { - return [OFCharacterSet_URLSchemeAllowed URLSchemeAllowedCharacterSet]; + return [OFURLSchemeAllowedCharacterSet URLSchemeAllowedCharacterSet]; } + (OFCharacterSet *)URLHostAllowedCharacterSet { - return [OFCharacterSet_URLAllowed URLAllowedCharacterSet]; + return [OFURLAllowedCharacterSet URLAllowedCharacterSet]; } + (OFCharacterSet *)URLUserAllowedCharacterSet { - return [OFCharacterSet_URLAllowed URLAllowedCharacterSet]; + return [OFURLAllowedCharacterSet URLAllowedCharacterSet]; } + (OFCharacterSet *)URLPasswordAllowedCharacterSet { - return [OFCharacterSet_URLAllowed URLAllowedCharacterSet]; + return [OFURLAllowedCharacterSet URLAllowedCharacterSet]; } + (OFCharacterSet *)URLPathAllowedCharacterSet { - return [OFCharacterSet_URLPathAllowed URLPathAllowedCharacterSet]; + return [OFURLPathAllowedCharacterSet URLPathAllowedCharacterSet]; } + (OFCharacterSet *)URLQueryAllowedCharacterSet { - return [OFCharacterSet_URLQueryOrFragmentAllowed + return [OFURLQueryOrFragmentAllowedCharacterSet URLQueryOrFragmentAllowedCharacterSet]; } + (OFCharacterSet *)URLFragmentAllowedCharacterSet { - return [OFCharacterSet_URLQueryOrFragmentAllowed + return [OFURLQueryOrFragmentAllowedCharacterSet URLQueryOrFragmentAllowedCharacterSet]; } @end @implementation OFURL @@ -702,18 +701,18 @@ void *pool = objc_autoreleasePoolPush(); #if defined(OF_WINDOWS) || defined(OF_MSDOS) isDirectory = ([path hasSuffix: @"\\"] || [path hasSuffix: @"/"] || - [OFURLHandler_file of_directoryExistsAtPath: path]); + [OFFileURLHandler of_directoryExistsAtPath: path]); #elif defined(OF_AMIGAOS) isDirectory = ([path hasSuffix: @"/"] || [path hasSuffix: @":"] || - [OFURLHandler_file of_directoryExistsAtPath: path]); + [OFFileURLHandler of_directoryExistsAtPath: path]); #else isDirectory = ([path hasSuffix: @"/"] || - [OFURLHandler_file of_directoryExistsAtPath: path]); + [OFFileURLHandler of_directoryExistsAtPath: path]); #endif objc_autoreleasePoolPop(pool); } @catch (id e) { [self release];