27 lines
636 B
Mathematica
27 lines
636 B
Mathematica
|
#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
|