Differences From Artifact [28eeb45980]:
- File src/OFCString.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: 1263) [annotate] [blame] [check-ins using]
To Artifact [dc3a9e9583]:
- File
src/OFCString.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: 1385) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
51 52 53 54 55 56 57 58 59 60 | - (int)compareTo: (OFString*)str { return strcmp(string, [str cString]); } - (OFString*)append: (OFString*)str { char *newstr; size_t newlen, strlength; | > > > > > | | | | | 51 52 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 | - (int)compareTo: (OFString*)str { return strcmp(string, [str cString]); } - (OFString*)append: (OFString*)str { return [self appendCString: [str cString]]; } - (OFString*)appendCString: (const char*)str { char *newstr; size_t newlen, strlength; if (string == NULL) return [self setTo: [OFString newWithCString: (char*)str]]; strlength = strlen(str); newlen = length + strlength; newstr = [self resizeMem: string toSize: newlen + 1]; memcpy(newstr + length, str, strlength + 1); length = newlen; string = newstr; return self; } @end |