X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/7fb3cc0fc3898a1f1c562924fe8a8f75b5a75132..2fd3803f9b993755221dfc1cca2588cd7c9e3aac:/UICaboodle/UCString.h diff --git a/UICaboodle/UCString.h b/UICaboodle/UCString.h index 77ee6a1b..d776728a 100644 --- a/UICaboodle/UCString.h +++ b/UICaboodle/UCString.h @@ -3,8 +3,14 @@ #import +@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*/