diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2009-06-17 06:42:06 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:13:15 +0000 |
commit | 11cd030858934f62f5e91b0bff5924f8fa098f90 (patch) | |
tree | dce7be141e4bbb59c5d1bfed671262694b086e87 /UICaboodle/UCString.h | |
parent | 43f3d7f667a56659b4ac4b2e8171fbf8b7cc3c94 (diff) |
20 minutes of typing.
Diffstat (limited to 'UICaboodle/UCString.h')
-rw-r--r-- | UICaboodle/UCString.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/UICaboodle/UCString.h b/UICaboodle/UCString.h index 77ee6a1..d776728 100644 --- a/UICaboodle/UCString.h +++ b/UICaboodle/UCString.h @@ -3,8 +3,14 @@ #import <Foundation/NSString.h> +@interface NSString (UIKit) +- (NSString *) stringByAddingPercentEscapes; +- (NSString *) stringByReplacingCharacter:(unsigned short)arg0 withCharacter:(unsigned short)arg1; +@end + @interface NSString (UICaboodle) + (NSString *) stringWithDataSize:(double)size; +- (NSString *) stringByAddingPercentEscapesIncludingReserved; @end @implementation NSString (UICaboodle) @@ -21,6 +27,16 @@ return [NSString stringWithFormat:@"%.1f%s", size, powers_[power]]; } +- (NSString *) stringByAddingPercentEscapesIncludingReserved { + return [(id)CFURLCreateStringByAddingPercentEscapes( + kCFAllocatorDefault, + (CFStringRef) self, + NULL, + CFSTR(";/?:@&=+$,"), + kCFStringEncodingUTF8 + ) autorelease]; +} + @end #endif/*UICABOODLE_UCSTRING_H*/ |