@@ -25,10 +25,11 @@ # import "OFFileManager.h" # import "OFFileURIHandler.h" #endif #import "OFNumber.h" #import "OFOnce.h" +#import "OFPair.h" #import "OFString.h" #import "OFXMLElement.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" @@ -1039,22 +1040,23 @@ - (OFString *)percentEncodedQuery { return _percentEncodedQuery; } -- (OFDictionary OF_GENERIC(OFString *, OFString *) *)queryDictionary +- (OFArray OF_GENERIC(OFPair OF_GENERIC(OFString *, OFString *) *) *)queryItems { void *pool; OFArray OF_GENERIC(OFString *) *pairs; - OFMutableDictionary OF_GENERIC(OFString *, OFString *) *ret; + OFMutableArray OF_GENERIC(OFPair OF_GENERIC(OFString *, OFString *) *) + *ret; if (_percentEncodedQuery == nil) return nil; pool = objc_autoreleasePoolPush(); pairs = [_percentEncodedQuery componentsSeparatedByString: @"&"]; - ret = [OFMutableDictionary dictionaryWithCapacity: pairs.count]; + ret = [OFMutableArray arrayWithCapacity: pairs.count]; for (OFString *pair in pairs) { OFArray *parts = [pair componentsSeparatedByString: @"="]; OFString *name, *value; @@ -1064,11 +1066,12 @@ name = [[parts objectAtIndex: 0] stringByRemovingPercentEncoding]; value = [[parts objectAtIndex: 1] stringByRemovingPercentEncoding]; - [ret setObject: value forKey: name]; + [ret addObject: [OFPair pairWithFirstObject: name + secondObject: value]]; } [ret makeImmutable]; [ret retain];