]> git.saurik.com Git - cydia.git/blobdiff - UICaboodle/UCString.h
chpwn got the "blink only for essential packages" logic backwards, and claims to...
[cydia.git] / UICaboodle / UCString.h
index 77ee6a1b3060884e2055abe82b95bc4108adcda2..13bb51f33dc52c650b0b24e604e20c1f03b7496f 100644 (file)
@@ -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)
     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*/