Monotone-Revision: 91089a095425fe50c525dea5f59628b15c8b029c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-07-11T17:29:09 Monotone-Branch: ca.inverse.sogo
27 lines
636 B
Objective-C
27 lines
636 B
Objective-C
#import "NSString+URL.h"
|
|
#import "NSDictionary+URL.h"
|
|
|
|
@implementation NSString (SOGoURLExtension)
|
|
|
|
- (NSString *) composeURLWithAction: (NSString *) action
|
|
parameters: (NSDictionary *) urlParameters
|
|
andHash: (BOOL) useHash
|
|
{
|
|
NSMutableString *completeURL;
|
|
|
|
completeURL = [NSMutableString new];
|
|
[completeURL autorelease];
|
|
|
|
[completeURL appendString: self];
|
|
if (![completeURL hasSuffix: @"/"])
|
|
[completeURL appendString: @"/"];
|
|
[completeURL appendString: action];
|
|
[completeURL appendString: [urlParameters asURLParameters]];
|
|
if (useHash)
|
|
[completeURL appendString: @"#"];
|
|
|
|
return completeURL;
|
|
}
|
|
|
|
@end
|