Overview
Comment: | Add -[caseInsensitiveCompare:] and fix -[compare:]. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
35fda90cf582abdbc01bbbf98c71f219 |
User & Date: | js on 2009-11-13 14:30:06 |
Other Links: | manifest | tags |
Context
2009-11-13
| ||
18:29 | Add -[hash] for OFList. check-in: eb67bc40fa user: js tags: trunk | |
14:30 | Add -[caseInsensitiveCompare:] and fix -[compare:]. check-in: 35fda90cf5 user: js tags: trunk | |
2009-11-10
| ||
20:13 | Fix a typo in TableGenerator.m and the resulting unicode.h. check-in: c628317621 user: js tags: trunk | |
Changes
Modified src/OFDataArray.m from [dff98ec80e] to [f5681d0dfa].
︙ | |||
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | + - - - - + + + + + + + - - + - - + - + | return YES; } - (of_comparison_result_t)compare: (OFDataArray*)ary { int cmp; size_t ary_count, min_count; if (![ary isKindOfClass: [OFDataArray class]]) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; if ([ary itemsize] != itemsize) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; |
︙ |
Modified src/OFString.h from [a8cd4bc958] to [eec9378345].
︙ | |||
204 205 206 207 208 209 210 211 212 213 214 215 216 217 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | + + + + + + + + | * Compares the OFString to another OFString. * * \param str A string to compare with * \return An of_comparison_result_t */ - (of_comparison_result_t)compare: (OFString*)str; /** * Compares the OFString to another OFString without caring about the case. * * \param str A string to compare with * \return An of_comparison_result_t */ - (of_comparison_result_t)caseInsensitiveCompare: (OFString*)str; /** * \param index The index of the Unicode character to return * \return The Unicode character at the specified index */ - (of_unichar_t)characterAtIndex: (size_t)index; /** |
︙ |
Modified src/OFString.m from [b097e022e5] to [dcfcc7e490].
︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | + | #import "OFString.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" #import "OFMacros.h" #import "asprintf.h" #import "unicode.h" extern const uint16_t of_iso_8859_15[256]; extern const uint16_t of_windows_1252[256]; /* References for static linking */ void _references_to_categories_of_OFString() { |
︙ | |||
566 567 568 569 570 571 572 573 574 575 576 577 | 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 | + - - - + + + + + - + - - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + | { return [[OFMutableString alloc] initWithString: self]; } - (of_comparison_result_t)compare: (OFString*)str { int cmp; size_t str_len, min_len; if (![str isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; |
︙ |
Modified tests/OFDataArray.m from [1c9d8d3ad2] to [9aaf176836].
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | - + | static OFString *module; const char *str = "Hello!"; static void do_tests(Class class) { |
︙ | |||
57 58 59 60 61 62 63 64 65 66 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | + + + + + - + + | fromCArray: [array[0] cArray]] && [array[1] isEqual: array[0]] && [array[1] removeNItems: 1] && ![array[0] isEqual: array[1]]) TEST(@"-[copy]", (array[1] = [[array[0] copy] autorelease]) && [array[0] isEqual: array[1]]) array[2] = [OFDataArray dataArrayWithItemSize: 1]; array[3] = [OFDataArray dataArrayWithItemSize: 1]; [array[2] addItem: "a"]; [array[2] addItem: "a"]; [array[3] addItem: "z"]; TEST(@"-[compare]", [array[0] compare: array[1]] == 0 && [array[1] removeNItems: 1] && [array[0] compare: array[1]] == OF_ORDERED_DESCENDING && |
︙ |
Modified tests/OFString.m from [335c787098] to [5db36dc58d].
︙ | |||
50 51 52 53 54 55 56 | 50 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 | - + + + + + + + + + + + + + + + | s[1] = [OFMutableString string]; s[2] = [[s[0] copy] autorelease]; TEST(@"-[isEqual:]", [s[0] isEqual: s[2]] && ![s[0] isEqual: [[[OFObject alloc] init] autorelease]]) TEST(@"-[compare:]", [s[0] compare: s[2]] == OF_ORDERED_SAME && |
︙ |