Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -267,13 +267,12 @@ if (secondsElement == nil || microsecondsElement == nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; - seconds = (int64_t)[[secondsElement stringValue] decimalValue]; - microseconds = - (uint32_t)[[microsecondsElement stringValue] decimalValue]; + seconds = (int64_t)[secondsElement decimalValue]; + microseconds = (uint32_t)[microsecondsElement decimalValue]; [pool release]; } @catch (id e) { [self release]; @throw e; Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -740,14 +740,14 @@ /* * FIXME: This will fail if the value is bigger than * INTMAX_MAX! */ type = OF_NUMBER_UINTMAX; - value.uintmax = [[element stringValue] decimalValue]; + value.uintmax = [element decimalValue]; } else if ([typeString isEqual: @"signed"]) { type = OF_NUMBER_INTMAX; - value.intmax = [[element stringValue] decimalValue]; + value.intmax = [element decimalValue]; } else if ([typeString isEqual: @"float"]) { union { float f; uint32_t i; } f; Index: src/OFXMLAttribute.h ================================================================== --- src/OFXMLAttribute.h +++ src/OFXMLAttribute.h @@ -70,6 +70,26 @@ /** * \return The string value of the attribute as an autoreleased OFString */ - (OFString*)stringValue; + +/** + * \return An integer with the decimal value of the attribute + */ +- (intmax_t)decimalValue; + +/** + * \return An integer with the hexadecimal value of the attribute + */ +- (uintmax_t)hexadecimalValue; + +/** + * \return A float with the float value of the attribute + */ +- (float)floatValue; + +/** + * \return A double with the double value of the attribute + */ +- (double)doubleValue; @end Index: src/OFXMLAttribute.m ================================================================== --- src/OFXMLAttribute.m +++ src/OFXMLAttribute.m @@ -108,10 +108,30 @@ - (OFString*)stringValue { return [[stringValue copy] autorelease]; } + +- (intmax_t)decimalValue +{ + return [stringValue decimalValue]; +} + +- (uintmax_t)hexadecimalValue +{ + return [stringValue hexadecimalValue]; +} + +- (float)floatValue +{ + return [stringValue floatValue]; +} + +- (double)doubleValue +{ + return [stringValue doubleValue]; +} - (BOOL)isEqual: (id)object { OFXMLAttribute *otherAttribute;