Differences From Artifact [b09a7e72c1]:
- File src/OFString_UTF8.m — part of check-in [53af033b0e] at 2012-10-14 10:36:21 on branch trunk — More integer overflow checks. (user: js, size: 30585) [annotate] [blame] [check-ins using]
To Artifact [7a3937da16]:
- File
src/OFString_UTF8.m
— part of check-in
[fcaa549324]
at
2012-10-16 14:47:55
on branch trunk
— A few more API improvements.
This should make it more future-proof, as adding new options is easier
than adding new methods for each and every combination of options. (user: js, size: 30604) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
1038 1039 1040 1041 1042 1043 1044 | memcpy(buffer, unicodeString + range.location, range.length * sizeof(of_unichar_t)); objc_autoreleasePoolPop(pool); } - (of_range_t)rangeOfString: (OFString*)string | | | 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 | memcpy(buffer, unicodeString + range.location, range.length * sizeof(of_unichar_t)); objc_autoreleasePoolPop(pool); } - (of_range_t)rangeOfString: (OFString*)string options: (int)options range: (of_range_t)range { const char *cString = [string UTF8String]; size_t i, cStringLength = [string UTF8StringLength]; size_t rangeLocation, rangeLength; if (range.length > SIZE_MAX - range.location || |
︙ | ︙ | |||
1156 1157 1158 1159 1160 1161 1162 | return NO; return !memcmp(s->cString + (s->cStringLength - cStringLength), [suffix UTF8String], cStringLength); } - (OFArray*)componentsSeparatedByString: (OFString*)delimiter | | > | 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 | return NO; return !memcmp(s->cString + (s->cStringLength - cStringLength), [suffix UTF8String], cStringLength); } - (OFArray*)componentsSeparatedByString: (OFString*)delimiter options: (int)options { void *pool; OFMutableArray *array; const char *cString = [delimiter UTF8String]; size_t cStringLength = [delimiter UTF8StringLength]; BOOL skipEmpty = (options & OF_STRING_SKIP_EMPTY); size_t i, last; OFString *component; array = [OFMutableArray array]; pool = objc_autoreleasePoolPush(); if (cStringLength > s->cStringLength) { |
︙ | ︙ |