Cube  OFString+Cube.m at [0e7605d101]

File src/OFString+Cube.m artifact 73a4498977 part of check-in 0e7605d101


#import "OFString+Cube.h"

#include "cube.h"

@implementation
OFString (Cube)
- (int)cube_intValue
{
	@try {
		return self.intValue;
	} @catch (OFInvalidFormatException *e) {
		conoutf(@"invalid value: %@", self);
		return 0;
	} @catch (OFOutOfRangeException *e) {
		conoutf(@"invalid value: %@", self);
		return 0;
	}
}

- (int)cube_intValueWithBase:(unsigned char)base
{
	@try {
		return [self intValueWithBase:base];
	} @catch (OFInvalidFormatException *e) {
		conoutf(@"invalid value: %@", self);
		return 0;
	} @catch (OFOutOfRangeException *e) {
		conoutf(@"invalid value: %@", self);
		return 0;
	}
}
@end