1 #ifndef UICABOODLE_UCSTRING_H
2 #define UICABOODLE_UCSTRING_H
4 #import <Foundation/NSString.h>
6 @interface
NSString (UIKit
)
7 - (NSString
*) stringByAddingPercentEscapes
;
8 - (NSString
*) stringByReplacingCharacter
:(unsigned short)arg0 withCharacter
:(unsigned short)arg1
;
11 @interface
NSString (UICaboodle
)
12 + (NSString
*) stringWithDataSize
:(double)size
;
13 - (NSString
*) stringByAddingPercentEscapesIncludingReserved
;
16 @implementation
NSString (UICaboodle
)
18 + (NSString
*) stringWithDataSize
:(double)size
{
25 static const char *powers_
[] = {"B", "KiB", "MiB", "GiB"};
27 return [NSString stringWithFormat
:@
"%.1f%s", size
, powers_
[power
]];
30 - (NSString
*) stringByAddingPercentEscapesIncludingReserved
{
31 return [(id
)CFURLCreateStringByAddingPercentEscapes(
42 #endif/*UICABOODLE_UCSTRING_H*/