1 #import "ITCategory-NSString.h"
3 @implementation NSString (ITFoundationCategory)
5 + (id)stringWithFourCharCode:(unsigned long)fourCharCode {
6 return [[[self alloc] initWithFourCharCode:fourCharCode] autorelease];
9 - (id)initWithFourCharCode:(unsigned long)fourCharCode {
10 return UTCreateStringForOSType(fourCharCode);
11 //return [self initWithFormat:@"%.4s", &fourCharCode];
14 - (unsigned long)fourCharCode {
15 return UTGetOSTypeFromString((CFStringRef)self);
17 //Die nasty bitshifting
18 /*const unsigned char *c_s = [self UTF8String];
19 unsigned long tmp = *c_s++;
25 return tmp |= *c_s++;*/