Differences From Artifact [7d58812826]:
- File
src/OFCString.m
— part of check-in
[7a49441656]
at
2008-10-09 00:25:31
on branch trunk
— Multiple changes, see details.
* Use config.h.
* Check whether to use sel_get_name or sel_getName.
* Rename freeWithData to freeIncludingData. (user: js, size: 1231) [annotate] [blame] [check-ins using]
To 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]
︙ | ︙ | |||
14 15 16 17 18 19 20 | #import <stdlib.h> #import <string.h> #import "OFCString.h" #import "OFExceptions.h" @implementation OFCString | | > > > > > | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #import <stdlib.h> #import <string.h> #import "OFCString.h" #import "OFExceptions.h" @implementation OFCString - initWithCString: (char*)str { if ((self = [super init])) { if (str == NULL) { length = 0; string = NULL; } else { length = strlen(str); string = [self getMemWithSize: length + 1]; memcpy(string, str, length + 1); } } return self; } - (char*)cString { return string; } - (size_t)length { return length; } - (OFString*)clone { return [OFString newWithCString: string]; } - (int)compareTo: (OFString*)str |
︙ | ︙ |