Index: src/OFCString.m ================================================================== --- src/OFCString.m +++ src/OFCString.m @@ -43,11 +43,11 @@ return length; } - (OFString*)clone { - return [OFString newWithCString: string]; + return [OFString newAsCString: string]; } - (int)compareTo: (OFString*)str { return strcmp(string, [str cString]); @@ -62,11 +62,11 @@ { char *newstr; size_t newlen, strlength; if (string == NULL) - return [self setTo: [OFString newWithCString: (char*)str]]; + return [self setTo: [OFString newAsCString: (char*)str]]; strlength = strlen(str); newlen = length + strlength; newstr = [self resizeMem: string Index: src/OFConstCString.m ================================================================== --- src/OFConstCString.m +++ src/OFConstCString.m @@ -39,13 +39,13 @@ return length; } - (OFString*)clone { - return [OFString newWithConstCString: string]; + return [OFString newAsConstCString: string]; } - (int)compareTo: (OFString*)str { return strcmp(string, [str cString]); } @end Index: src/OFConstWideCString.m ================================================================== --- src/OFConstWideCString.m +++ src/OFConstWideCString.m @@ -39,13 +39,13 @@ return length; } - (OFString*)clone { - return [OFString newWithConstWideCString: string]; + return [OFString newAsConstWideCString: string]; } - (int)compareTo: (OFString*)str { return wcscmp(string, [str wcString]); } @end Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -12,20 +12,20 @@ #import #import #import "OFObject.h" @interface OFString: OFObject -+ newWithConstCString: (const char*)str; -+ newWithConstWideCString: (const wchar_t*)str; -+ newWithCString: (char*)str; -+ newWithWideCString: (wchar_t*)str; ++ newAsConstCString: (const char*)str; ++ newAsConstWideCString: (const wchar_t*)str; ++ newAsCString: (char*)str; ++ newAsWideCString: (wchar_t*)str; - (char*)cString; - (wchar_t*)wcString; - (size_t)length; - (OFString*)setTo: (OFString*)str; - (OFString*)clone; - (int)compareTo: (OFString*)str; - (OFString*)append: (OFString*)str; - (OFString*)appendCString: (const char*)str; -- (OFString*)appendWideCString: (const char*)str; +- (OFString*)appendWideCString: (const wchar_t*)str; @end Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -20,26 +20,26 @@ #import "OFCString.h" #import "OFWideCString.h" #import "OFExceptions.h" @implementation OFString -+ newWithConstCString: (const char*)str ++ newAsConstCString: (const char*)str { return [[OFConstCString alloc] initWithConstCString: str]; } -+ newWithConstWideCString: (const wchar_t*)str ++ newAsConstWideCString: (const wchar_t*)str { return [[OFConstWideCString alloc] initWithConstWideCString: str]; } -+ newWithCString: (char*)str ++ newAsCString: (char*)str { return [[OFCString alloc] initWithCString: str]; } -+ newWithWideCString: (wchar_t*)str ++ newAsWideCString: (wchar_t*)str { return [[OFWideCString alloc] initWithWideCString: str]; } - (char*)cString @@ -98,14 +98,14 @@ andSelector: @selector(appendCString:)] raise]; return nil; } -- (OFString*)appendWideCString: (const char*)str +- (OFString*)appendWideCString: (const wchar_t*)str { [[OFNotImplementedException newWithObject: self andSelector: @selector( appendWideCString:)] raise]; return nil; } @end Index: src/OFWideCString.m ================================================================== --- src/OFWideCString.m +++ src/OFWideCString.m @@ -45,11 +45,11 @@ return length; } - (OFString*)clone { - return [OFString newWithWideCString: string]; + return [OFString newAsWideCString: string]; } - (int)compareTo: (OFString*)str { return wcscmp(string, [str wcString]); @@ -65,11 +65,11 @@ wchar_t *newstr; size_t newlen, strlength; if (string == NULL) return [self setTo: [OFString - newWithWideCString: (wchar_t*)str]]; + newAsWideCString: (wchar_t*)str]]; strlength = wcslen(str); newlen = length + strlength; newstr = [self resizeMem: string Index: tests/OFList/OFList.m ================================================================== --- tests/OFList/OFList.m +++ tests/OFList/OFList.m @@ -30,13 +30,13 @@ OFList *list; OFListObject *iter; list = [OFList new]; - [list addNew: [OFString newWithConstCString: strings[0]]]; - [list addNew: [OFString newWithConstCString: strings[1]]]; - [list addNew: [OFString newWithConstCString: strings[2]]]; + [list addNew: [OFString newAsConstCString: strings[0]]]; + [list addNew: [OFString newAsConstCString: strings[1]]]; + [list addNew: [OFString newAsConstCString: strings[2]]]; for (iter = [list first], i = 0; iter != nil; iter = [iter next], i++) if (!strcmp([(OFString*)[iter data] cString], strings[i])) printf("Element %zu is expected element. GOOD!\n", i); else { Index: tests/OFString/OFString.m ================================================================== --- tests/OFString/OFString.m +++ tests/OFString/OFString.m @@ -17,16 +17,16 @@ /* TODO: Do real checks */ int main() { - OFString *s1 = [OFString newWithCString: "test"]; - OFString *s2 = [OFString newWithCString: ""]; + OFString *s1 = [OFString newAsCString: "test"]; + OFString *s2 = [OFString newAsCString: ""]; OFString *s3; - OFString *s4 = [OFString newWithConstCString: NULL]; + OFString *s4 = [OFString newAsConstCString: NULL]; - [s2 append: [OFString newWithConstCString: "123"]]; + [s2 appendCString: "123"]; s3 = [s1 clone]; [s4 setTo: s2]; if (![s1 compareTo: s3]) Index: tests/OFWideString/OFWideString.m ================================================================== --- tests/OFWideString/OFWideString.m +++ tests/OFWideString/OFWideString.m @@ -16,16 +16,16 @@ /* TODO: Do real checks */ int main() { - OFString *s1 = [OFString newWithWideCString: L"test"]; - OFString *s2 = [OFString newWithWideCString: L""]; + OFString *s1 = [OFString newAsWideCString: L"test"]; + OFString *s2 = [OFString newAsWideCString: L""]; OFString *s3; - OFString *s4 = [OFString newWithConstWideCString: NULL]; + OFString *s4 = [OFString newAsConstWideCString: NULL]; - [s2 append: [OFString newWithConstWideCString: L"123"]]; + [s2 appendWideCString: L"123"]; s3 = [s1 clone]; [s4 setTo: s2]; if (![s1 compareTo: s3])