Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -252,10 +252,30 @@ /** * \return A string with the string value of all children concatenated */ - (OFString*)stringValue; +/** + * \return An integer with the decimal value of all children concatenated + */ +- (intmax_t)decimalValue; + +/** + * \return An integer with the hexadecimal value of all children concatenated + */ +- (uintmax_t)hexadecimalValue; + +/** + * \return A float with the float value of all children concatenated + */ +- (float)floatValue; + +/** + * \return A double with the double value of all children concatenated + */ +- (double)doubleValue; + /** * \return A new autoreleased OFString representing the OFXMLElement as an * XML string */ - (OFString*)XMLString; Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -433,10 +433,30 @@ * would create a real copy each time -[copy] is called. */ ret->isa = [OFString class]; return ret; } + +- (intmax_t)decimalValue +{ + return [[self stringValue] decimalValue]; +} + +- (uintmax_t)hexadecimalValue +{ + return [[self stringValue] hexadecimalValue]; +} + +- (float)floatValue +{ + return [[self stringValue] floatValue]; +} + +- (double)doubleValue +{ + return [[self stringValue] doubleValue]; +} - (OFString*)_XMLStringWithParent: (OFXMLElement*)parent indentation: (unsigned int)indentation level: (size_t)level {