X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/d5db7abfd39fe9a9475d73c0d792b4ae56fe2b0c..d3aa466c92e3677aca0d4e7adff3bdcba1a00030:/UICaboodle/UCString.h?ds=inline diff --git a/UICaboodle/UCString.h b/UICaboodle/UCString.h index 77ee6a1b..13bb51f3 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*/