Differences From Artifact [920953956a]:
- File
src/OFMutableString.m
— part of check-in
[37db8f0fb3]
at
2010-04-17 22:27:17
on branch trunk
— New ivar naming convention.
ivars are now named like this: thisIsAnIVar. If an accessor exists for
the ivar, the ivar is named like the accessor. This is required for
@property to work. (user: js, size: 10749) [annotate] [blame] [check-ins using]
To Artifact [4f2f2b15be]:
- File src/OFMutableString.m — part of check-in [3f14a43fbf] at 2010-10-24 22:12:04 on branch trunk — Add -[OFMutableString replaceCharactersFromIndex:toIndex:withString:]. (user: js, size: 11705) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
383 384 385 386 387 388 389 390 391 392 393 394 395 396 | } - (void)removeCharactersInRange: (of_range_t)range { [self removeCharactersFromIndex: range.start toIndex: range.start + range.length]; } - (void)replaceOccurrencesOfString: (OFString*)str withString: (OFString*)repl { const char *str_c = [str cString]; const char *repl_c = [repl cString]; size_t str_len = [str cStringLength]; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | } - (void)removeCharactersInRange: (of_range_t)range { [self removeCharactersFromIndex: range.start toIndex: range.start + range.length]; } - (void)replaceCharactersFromIndex: (size_t)start toIndex: (size_t)end withString: (OFString*)repl { size_t nlen; if (isUTF8) { start = of_string_index_to_position(string, start, length); end = of_string_index_to_position(string, end, length); } if (start > end) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; if (end > length) @throw [OFOutOfRangeException newWithClass: isa]; nlen = length - (end - start) + [repl cStringLength]; string = [self resizeMemory: string toSize: nlen + 1]; memmove(string + end, string + start + [repl cStringLength], length - end); memcpy(string + start, [repl cString], [repl cStringLength]); string[nlen] = '\0'; length = nlen; } - (void)replaceCharactersInRange: (of_range_t)range withString: (OFString*)repl { [self replaceCharactersFromIndex: range.start toIndex: range.start + range.length withString: repl]; } - (void)replaceOccurrencesOfString: (OFString*)str withString: (OFString*)repl { const char *str_c = [str cString]; const char *repl_c = [repl cString]; size_t str_len = [str cStringLength]; |
︙ | ︙ |