summaryrefslogtreecommitdiff
path: root/UICaboodle/UCString.h
diff options
context:
space:
mode:
Diffstat (limited to 'UICaboodle/UCString.h')
-rw-r--r--UICaboodle/UCString.h16
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*/