Differences From Artifact [9dbc23240b]:
- File src/OFWideCString.m — part of check-in [7b15048e25] at 2008-10-11 20:26:22 on branch trunk — Move length from base string class to subclasses & others. (user: js, size: 1370) [annotate] [blame] [check-ins using]
To Artifact [39f7445e2b]:
- File
src/OFWideCString.m
— part of check-in
[e47ad44290]
at
2008-10-22 13:32:19
on branch trunk
— Reworked OFObject and added append(Wide)CString to OFString.
The reworked OFObject lets one test fail on the GNU runtime.
Unfortunately, I have no idea why... (user: js, size: 1504) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
53 54 55 56 57 58 59 60 61 62 | - (int)compareTo: (OFString*)str { return wcscmp(string, [str wcString]); } - (OFString*)append: (OFString*)str { wchar_t *newstr; size_t newlen, strlength; | > > > > > | | > | | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | - (int)compareTo: (OFString*)str { return wcscmp(string, [str wcString]); } - (OFString*)append: (OFString*)str { return [self appendWideCString: [str wcString]]; } - (OFString*)appendWideCString: (const wchar_t*)str { wchar_t *newstr; size_t newlen, strlength; if (string == NULL) return [self setTo: [OFString newWithWideCString: (wchar_t*)str]]; strlength = wcslen(str); newlen = length + strlength; newstr = [self resizeMem: string toSize: (newlen + 1) * sizeof(wchar_t)]; wmemcpy(newstr + length, str, strlength + 1); length = newlen; string = newstr; return self; } @end |