Lines Matching defs:string
30 * a code point or a string.
44 * max string length and U16_LENGTH/U8_LENGTH to account for
164 // Get the number of UTF-8 bytes for a UTF-16 (sub)string.
173 // The string contains an unpaired surrogate.
174 // Ignore this string.
179 // Append the UTF-8 version of the string to t and return the appended UTF-8 length.
188 // The string contains an unpaired surrogate.
189 // Ignore this string.
218 // If any string is relevant, then all strings need to be used for
229 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
230 const UChar *s16=string.getBuffer();
231 int32_t length16=string.length();
234 if(spanLength<length16) { // Relevant string.
309 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
310 const UChar *s16=string.getBuffer();
311 int32_t length16=string.length();
313 if(spanLength<length16) { // Relevant string.
349 // Add string start and end code points to the spanNotSet so that
350 // a span(while not contained) stops before any string.
363 } else { // Irrelevant string.
525 * Note: In span() when spanLength==0 (after a string match, or at the beginning
527 * string matching could use a binary search
528 * because all string matches are done from the same start index.
543 * - Iterate through the string, and at each code point boundary:
545 * + If a set string matches at the current position, then remember to continue after it.
546 * + Either recursively span for each code point or string match,
551 * nor for any set string, then stop and return the longest recursive span length.
556 * A span using a string-less set is extremely fast.)
563 * + Try to match each set string at the end of the spanLength.
571 * ~ Rather than recursing, note each end point of a set string match.
572 * + If no set string matched after spanSet.span(), then return
574 * + If at least one set string matched after spanSet.span(), then
575 * pop the shortest string match end point and continue
577 * + If at least one more set string matched after a previous string match,
578 * then test if the code point after the previous string match is also
581 * or a matching set string.
582 * + If no more set string matched after a previous string match,
586 * By noting each end point of a set string match,
587 * the function visits each string position at most once and finishes
590 * The recursive algorithm may visit the same string position many times
598 * - Iterate through the string, and at each code point boundary:
600 * + If a set string matches at the current position, then remember to continue after it.
611 * + Try to match each set string at the end of the spanLength.
617 * would hide set string matches that end earlier.
620 * the set string match anyway.
621 * ~ Remember the longest set string match (farthest end point) from the earliest
623 * + If no set string matched after spanSet.span(), then return
625 * + If at least one set string matched, then continue the loop after the
627 * + If no more set string matched after a previous string match,
654 continue; // Irrelevant string.
656 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
657 const UChar *s16=string.getBuffer();
658 int32_t length16=string.length();
660 // Try to match this string at pos-overlap..pos.
664 U16_BACK_1(s16, 0, overlap); // Length of the string minus the last code point.
677 return length; // Reached the end of the string.
692 // For longest match, we do need to try to match even an all-contained string
695 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
696 const UChar *s16=string.getBuffer();
697 int32_t length16=string.length();
699 // Try to match this string at pos-overlap..pos.
713 // Try to match if the string is longer or starts earlier.
727 // Longest-match algorithm, and there was a string match.
732 return length; // Reached the end of the string.
734 spanLength=0; // Match strings from after a string match.
742 // not after a string match.
749 // Match strings from after the next string match.
751 // The position is after a string match (or a single code point).
753 // No more strings matched after a previous string match.
754 // Try another code point span from after the last string match.
756 if( spanLength==rest || // Reached the end of the string, or
765 // Try to match only one code point from after a string match if some
766 // string matched beyond it, so that we try all possible positions
771 return length; // Reached the end of the string.
782 // Match strings from after the next string match.
788 spanLength=0; // Match strings from after a string match.
818 continue; // Irrelevant string.
820 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
821 const UChar *s16=string.getBuffer();
822 int32_t length16=string.length();
824 // Try to match this string at pos-(length16-overlap)..pos-length16.
830 overlap-=len1; // Length of the string minus the first code point.
843 string.
858 // For longest match, we do need to try to match even an all-contained string
861 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
862 const UChar *s16=string.getBuffer();
863 int32_t length16=string.length();
865 // Try to match this string at pos-(length16-overlap)..pos-length16.
879 // Try to match if the string is longer or ends later.
893 // Longest-match algorithm, and there was a string match.
897 return 0; // Reached the start of the string.
899 spanLength=0; // Match strings from before a string match.
907 // not before a string match.
914 // Match strings from before the next string match.
916 // The position is before a string match (or a single code point).
918 // No more strings matched before a previous string match.
919 // Try another code point span from before the last string match.
923 if( pos==0 || // Reached the start of the string, or
930 // Try to match only one code point from before a string match if some
931 // string matched beyond it, so that we try all possible positions
936 return 0; // Reached the start of the string.
946 // Match strings from before the next string match.
950 spanLength=0; // Match strings from before a string match.
982 continue; // String not representable in UTF-8.
987 continue; // Irrelevant string.
990 // Try to match this string at pos-overlap..pos.
994 U8_BACK_1(s8, 0, overlap); // Length of the string minus the last code point.
1013 return length; // Reached the end of the string.
1030 continue; // String not representable in UTF-8.
1033 // For longest match, we do need to try to match even an all-contained string
1036 // Try to match this string at pos-overlap..pos.
1050 // Try to match if the string is longer or starts earlier.
1069 // Longest-match algorithm, and there was a string match.
1074 return length; // Reached the end of the string.
1076 spanLength=0; // Match strings from after a string match.
1084 // not after a string match.
1091 // Match strings from after the next string match.
1093 // The position is after a string match (or a single code point).
1095 // No more strings matched after a previous string match.
1096 // Try another code point span from after the last string match.
1098 if( spanLength==rest || // Reached the end of the string, or
1107 // Try to match only one code point from after a string match if some
1108 // string matched beyond it, so that we try all possible positions
1113 return length; // Reached the end of the string.
1124 // Match strings from after the next string match.
1130 spanLength=0; // Match strings from after a string match.
1162 continue; // String not representable in UTF-8.
1167 continue; // Irrelevant string.
1170 // Try to match this string at pos-(length8-overlap)..pos-length8.
1176 overlap-=len1; // Length of the string minus the first code point.
1194 return 0; // Reached the start of the string.
1211 continue; // String not representable in UTF-8.
1214 // For longest match, we do need to try to match even an all-contained string
1217 // Try to match this string at pos-(length8-overlap)..pos-length8.
1231 // Try to match if the string is longer or ends later.
1249 // Longest-match algorithm, and there was a string match.
1253 return 0; // Reached the start of the string.
1255 spanLength=0; // Match strings from before a string match.
1263 // not before a string match.
1270 // Match strings from before the next string match.
1272 // The position is before a string match (or a single code point).
1274 // No more strings matched before a previous string match.
1275 // Try another code point span from before the last string match.
1279 if( pos==0 || // Reached the start of the string, or
1286 // Try to match only one code point from before a string match if some
1287 // string matched beyond it, so that we try all possible positions
1292 return 0; // Reached the start of the string.
1302 // Match strings from before the next string match.
1306 spanLength=0; // Match strings from before a string match.
1314 * - Iterate through the string, and at each code point boundary:
1316 * + If a set string matches at the current position, then return with the current position.
1324 * For each set string add its initial code point to the spanNotSet.
1331 * + If any set string matches at the current position, then
1334 * nor for any set string, then skip this code point and continue the loop.
1335 * This happens for set-string-initial code points that were added to spanNotSet
1336 * when there is not actually a match for such a set string.
1344 // or a code point that starts or ends some string.
1347 return length; // Reached the end of the string.
1353 // without the string starts and ends.
1362 continue; // Irrelevant string.
1364 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
1365 const UChar *s16=string.getBuffer();
1366 int32_t length16=string.length();
1372 // The span(while not contained) ended on a string start/end which is
1378 return length; // Reached the end of the string.
1386 // or a code point that starts or ends some string.
1389 return 0; // Reached the start of the string.
1393 // without the string starts and ends.
1402 // it is easier and we only need to know whether the string is irrelevant
1405 continue; // Irrelevant string.
1407 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
1408 const UChar *s16=string.getBuffer();
1409 int32_t length16=string.length();
1415 // The span(while not contained) ended on a string start/end which is
1420 return 0; // Reached the start of the string.
1432 // or a code point that starts or ends some string.
1435 return length; // Reached the end of the string.
1441 // without the string starts and ends.
1452 // ALL_CP_CONTAINED: Irrelevant string.
1459 // The span(while not contained) ended on a string start/end which is
1465 return length; // Reached the end of the string.
1477 // or a code point that starts or ends some string.
1480 return 0; // Reached the start of the string.
1484 // without the string starts and ends.
1495 // ALL_CP_CONTAINED: Irrelevant string.
1502 // The span(while not contained) ended on a string start/end which is
1507 return 0; // Reached the start of the string.