Cube/src/OFString+Cube.m
Jonathan Schleifer 565a845aaf Convert several files to pure Objective-C
FossilOrigin-Name: eac9e3d9480c641e752bce15f24de48bbb77705cd44ef2bb9a04603ca04c67e1
2025-03-20 20:59:25 +00:00

32 lines
613 B
Objective-C

#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