X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/7fb3cc0fc3898a1f1c562924fe8a8f75b5a75132..3203e099e81f1fb5961c7666c30384d875dd7d2c:/UICaboodle/UCString.h?ds=sidebyside 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*/