Index: src/OFMutableString.h ================================================================== --- src/OFMutableString.h +++ src/OFMutableString.h @@ -23,24 +23,24 @@ * * \param str An OFString to set the OFString to. */ - setToCString: (const char*)str; -/** - * Appends another OFString to the OFString. - * - * \param str An OFString to append - */ -- append: (OFString*)str; - /** * Appends a C string to the OFString. * * \param str A C string to append */ - appendCString: (const char*)str; +/** + * Appends another OFString to the OFString. + * + * \param str An OFString to append + */ +- appendString: (OFString*)str; + /** * Appends a formatted C string to the OFString. * See printf for the format syntax. * * \param fmt A format string which generates the string to append Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -62,15 +62,10 @@ memcpy(string, str, length + 1); return self; } -- append: (OFString*)str -{ - return [self appendCString: [str cString]]; -} - - appendCString: (const char*)str { size_t strlength; strlength = strlen(str); @@ -88,10 +83,15 @@ memcpy(string + length, str, strlength + 1); length += strlength; return self; } + +- appendString: (OFString*)str +{ + return [self appendCString: [str cString]]; +} - appendWithFormat: (OFString*)fmt, ... { id ret; va_list args; Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -133,12 +133,12 @@ * \return An autoreleased OFArray with the splitted string */ - (OFArray*)splitWithDelimiter: (OFString*)delimiter; - setToCString: (const char*)str; -- append: (OFString*)str; - appendCString: (const char*)str; +- appendString: (OFString*)str; - appendWithFormat: (OFString*)fmt, ...; - appendWithFormat: (OFString*)fmt andArguments: (va_list)args; - reverse; - upper; Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -371,17 +371,17 @@ { @throw [OFNotImplementedException newWithClass: isa andSelector: _cmd]; } -- append: (OFString*)str -{ - @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; -} - - appendCString: (const char*)str +{ + @throw [OFNotImplementedException newWithClass: isa + andSelector: _cmd]; +} + +- appendString: (OFString*)str { @throw [OFNotImplementedException newWithClass: isa andSelector: _cmd]; } Index: tests/OFString/OFString.m ================================================================== --- tests/OFString/OFString.m +++ tests/OFString/OFString.m @@ -68,15 +68,15 @@ CHECK([s1 isEqual: s3]) CHECK(![s1 isEqual: [[OFObject alloc] init]]) CHECK([s1 hash] == [s3 hash]) [s2 appendCString: "12"]; - [s2 append: @"3"]; + [s2 appendString: @"3"]; [s4 setToCString: [s2 cString]]; CHECK(![s2 compare: s4]) - CHECK(!strcmp([[s1 append: s2] cString], "test123")) + CHECK(!strcmp([[s1 appendString: s2] cString], "test123")) CHECK([s1 hash] == 0xC44F49A4) CHECK(strlen([s1 cString]) == [s1 length] && [s1 length] == 7) CHECK(!strcmp([[s1 reverse] cString], "321tset")) CHECK(!strcmp([[s1 upper] cString], "321TSET")) CHECK(!strcmp([[s1 lower] cString], "321tset"))