Lines Matching refs:ut

25 UText *openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status);
163 UText *ut = NULL;
189 ut = utext_openUChars(NULL, buf, -1, &status);
191 TestAccess(sa, ut, cpCount, cpMap);
192 utext_close(ut);
200 ut = utext_openUChars(NULL, buf, saLen, &status);
202 TestAccess(sa, ut, cpCount, cpMap);
203 utext_close(ut);
209 ut = utext_openUnicodeString(NULL, &sa, &status);
211 TestAccess(sa, ut, cpCount, cpMap);
212 TestCMR(sa, ut, cpCount, cpMap, cpMap);
213 utext_close(ut);
218 ut = utext_openConstUnicodeString(NULL, &sa, &status);
220 TestAccess(sa, ut, cpCount, cpMap);
221 utext_close(ut);
226 ut = utext_openReplaceable(NULL, &sa, &status);
228 TestAccess(sa, ut, cpCount, cpMap);
229 TestCMR(sa, ut, cpCount, cpMap, cpMap);
230 utext_close(ut);
237 ut = utext_openCharacterIterator(NULL, ci, &status);
239 TestAccess(sa, ut, cpCount, cpMap);
240 utext_close(ut);
247 ut = openFragmentedUnicodeString(NULL, &sa, &status);
249 TestAccess(sa, ut, cpCount, cpMap);
250 utext_close(ut);
273 ut = utext_openUTF8(NULL, u8String, -1, &status);
275 TestAccess(sa, ut, cpCount, u8Map);
276 utext_close(ut);
287 // ut UText containing the same test text.
295 void UTextTest::TestCMR(const UnicodeString &us, UText *ut, int cpCount, m *nativeMap, m *u16Map) {
296 TEST_ASSERT(utext_isWritable(ut) == TRUE);
365 TestCopyMove(us, ut, FALSE,
369 TestCopyMove(us, ut, TRUE,
384 TestReplace(us, ut,
402 void UTextTest::TestCopyMove(const UnicodeString &us, UText *ut, UBool move,
415 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status);
459 int64_t expectedNativeLength = utext_nativeLength(ut);
477 UText *ut, // UnicodeText object under test.
493 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status);
536 expectedNativeLength = utext_nativeLength(ut) + expectedDelta;
549 void UTextTest::TestAccess(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) {
551 TestAccessNoClone(us, ut, cpCount, cpMap);
554 utext_setNativeIndex(ut, 0);
556 UText *shallowClone = utext_clone(NULL, ut, FALSE /*deep*/, FALSE /*readOnly*/, &status);
582 void UTextTest::TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) {
590 int64_t utlen = utext_nativeLength(ut);
607 foundIndex = utext_getNativeIndex(ut);
610 foundC = utext_next32(ut);
612 foundIndex = utext_getPreviousNativeIndex(ut);
618 foundC = utext_next32(ut);
622 utext_setNativeIndex(ut, 0);
625 foundIndex = UTEXT_GETNATIVEINDEX(ut);
628 foundC = UTEXT_NEXT32(ut);
634 foundC = UTEXT_NEXT32(ut);
641 len = utext_nativeLength(ut);
642 foundIndex = utext_getNativeIndex(ut);
648 len = utext_getNativeIndex(ut);
649 utext_setNativeIndex(ut, len);
653 int64_t prevIndex = utext_getPreviousNativeIndex(ut);
654 foundC = utext_previous32(ut);
655 foundIndex = utext_getNativeIndex(ut);
668 foundIndex = utext_getNativeIndex(ut);
670 foundIndex = utext_getPreviousNativeIndex(ut);
674 foundC = utext_previous32(ut);
676 foundIndex = utext_getNativeIndex(ut);
678 foundIndex = utext_getPreviousNativeIndex(ut);
683 utext_setNativeIndex(ut, len);
687 foundC = UTEXT_PREVIOUS32(ut);
688 foundIndex = UTEXT_GETNATIVEINDEX(ut);
700 foundIndex = UTEXT_GETNATIVEINDEX(ut);
703 foundC = UTEXT_PREVIOUS32(ut);
705 foundIndex = UTEXT_GETNATIVEINDEX(ut);
719 foundC = utext_next32From(ut, index);
731 foundC = utext_previous32From(ut, index);
744 utext_setNativeIndex(ut, 0);
746 utext_moveIndex32(ut, 1);
747 index = utext_getNativeIndex(ut);
750 index = UTEXT_GETNATIVEINDEX(ut);
755 utext_setNativeIndex(ut, 0);
757 utext_moveIndex32(ut, 2);
758 index = utext_getNativeIndex(ut);
761 index = UTEXT_GETNATIVEINDEX(ut);
767 utext_setNativeIndex(ut, i);
770 index = utext_getNativeIndex(ut);
772 index = UTEXT_GETNATIVEINDEX(ut);
774 utext_moveIndex32(ut, -1);
780 utext_setNativeIndex(ut, i);
783 index = utext_getNativeIndex(ut);
785 index = UTEXT_GETNATIVEINDEX(ut);
787 utext_moveIndex32(ut, -3);
798 len = utext_extract(ut, 0, utlen, buf, bufSize, &status);
805 len = utext_extract(ut, 0, utlen, NULL, 0, &status);
815 len = utext_extract(ut, 0, utlen, buf, 1, &status);
844 UText ut;
845 memset(&ut, 0, sizeof(UText));
846 utext_close(&ut);
853 UText ut = UTEXT_INITIALIZER;
855 UText *ut2 = utext_openUnicodeString(&ut, &s, &status);
857 TEST_ASSERT(ut2 == &ut);
859 UText *ut3 = utext_close(&ut);
860 TEST_ASSERT(ut3 == &ut);
862 UText *ut4 = utext_close(&ut);
863 TEST_ASSERT(ut4 == &ut);
865 utext_openUnicodeString(&ut, &s, &status);
867 utext_close(&ut);
874 UText ut = UTEXT_INITIALIZER;
880 utp = utext_openUnicodeString(&ut, &s1, &status);
882 TEST_ASSERT(utp == &ut);
884 utp = utext_openConstUnicodeString(&ut, &s1, &status);
886 TEST_ASSERT(utp == &ut);
888 utp = utext_openUTF8(&ut, s3, -1, &status);
890 TEST_ASSERT(utp == &ut);
892 utp = utext_openUChars(&ut, s2, -1, &status);
894 TEST_ASSERT(utp == &ut);
896 utp = utext_close(&ut);
897 TEST_ASSERT(utp == &ut);
899 utp = utext_openUnicodeString(&ut, &s1, &status);
901 TEST_ASSERT(utp == &ut);
908 UText ut = UTEXT_INITIALIZER;
910 utext_openUChars(&ut, NULL, 5, &status);
914 utext_openUChars(&ut, NULL, -1, &status);
918 utext_openUTF8(&ut, NULL, 4, &status);
922 utext_openUTF8(&ut, NULL, -1, &status);
932 UText *ut = NULL;
936 ut = utext_openUTF8(NULL, badUTF8, -1, &status);
938 c = utext_char32At(ut, 1);
940 c = utext_char32At(ut, 3);
942 c = utext_char32At(ut, 5);
944 c = utext_char32At(ut, 6);
948 int n = utext_extract(ut, 0, 9, buf, 10, &status);
954 utext_close(ut);
1005 UText *ut = utext_openUTF8(NULL, u8str, -1, &status);
1012 utext_setNativeIndex(ut, i);
1013 int64_t cpIndex = utext_getNativeIndex(ut);
1015 cpIndex = UTEXT_GETNATIVEINDEX(ut);
1021 UChar32 c32 = utext_char32At(ut, i);
1023 int64_t cpIndex = utext_getNativeIndex(ut);
1029 UChar32 c32 = utext_next32From(ut, i);
1031 int64_t cpIndex = utext_getNativeIndex(ut);
1038 UChar32 c32 = utext_previous32From(ut, i);
1040 int64_t cpIndex = utext_getNativeIndex(ut);
1050 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
1061 utext_close(ut);
1078 UText *ut = utext_openUnicodeString(NULL, &u16str, &status);
1084 utext_setNativeIndex(ut, i);
1085 int64_t cpIndex = utext_getNativeIndex(ut);
1091 UChar32 c32 = utext_char32At(ut, i);
1093 int64_t cpIndex = utext_getNativeIndex(ut);
1099 UChar32 c32 = utext_next32From(ut, i);
1101 int64_t cpIndex = utext_getNativeIndex(ut);
1107 UChar32 c32 = utext_previous32From(ut, i);
1109 int64_t cpIndex = utext_getNativeIndex(ut);
1119 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
1130 utext_close(ut);
1146 UText *ut = utext_openReplaceable(NULL, &u16str, &status);
1152 utext_setNativeIndex(ut, i);
1153 int64_t cpIndex = utext_getNativeIndex(ut);
1159 UChar32 c32 = utext_char32At(ut, i);
1161 int64_t cpIndex = utext_getNativeIndex(ut);
1167 UChar32 c32 = utext_next32From(ut, i);
1169 int64_t cpIndex = utext_getNativeIndex(ut);
1175 UChar32 c32 = utext_previous32From(ut, i);
1177 int64_t cpIndex = utext_getNativeIndex(ut);
1187 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
1198 utext_close(ut);
1212 UText *ut = NULL;
1215 ut = utext_openUTF8(ut, u8str, -1, &status);
1217 UBool writable = utext_isWritable(ut);
1219 utext_copy(ut, 1, 2, 0, TRUE, &status);
1223 ut = utext_openUChars(ut, u16str, -1, &status);
1225 writable = utext_isWritable(ut);
1227 utext_copy(ut, 1, 2, 0, TRUE, &status);
1231 ut = utext_openUnicodeString(ut, &ustr, &status);
1233 writable = utext_isWritable(ut);
1235 utext_freeze(ut);
1236 writable = utext_isWritable(ut);
1238 utext_copy(ut, 1, 2, 0, TRUE, &status);
1242 ut = utext_openUnicodeString(ut, &ustr, &status);
1244 ut2 = utext_clone(ut2, ut, FALSE, FALSE, &status); // clone with readonly = false
1248 ut2 = utext_clone(ut2, ut, FALSE, TRUE, &status); // clone with readonly = true
1256 ut = utext_openConstUnicodeString(ut, (const UnicodeString *)&ustr, &status);
1258 writable = utext_isWritable(ut);
1260 utext_copy(ut, 1, 2, 0, TRUE, &status);
1265 ut = utext_openUnicodeString(ut, &ustr, &status);
1267 utext_freeze(ut);
1268 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone
1277 ut = utext_openUChars(ut, u16str, -1, &status);
1279 utext_freeze(ut);
1280 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone
1286 utext_close(ut);
1297 // ut.b the character. Put into both halves.
1302 fragTextAccess(UText *ut, int64_t index, UBool forward) {
1303 const UnicodeString *us = (const UnicodeString *)ut->context;
1308 ut->b = c | c<<16;
1309 ut->chunkOffset = 0;
1310 ut->chunkLength = 1;
1311 ut->chunkNativeStart = index;
1312 ut->chunkNativeLimit = index+1;
1317 ut->b = c | c<<16;
1318 ut->chunkOffset = 1;
1319 ut->chunkLength = 1;
1320 ut->chunkNativeStart = index-1;
1321 ut->chunkNativeLimit = index;
1324 ut->b = 0;
1325 ut->chunkOffset = 0;
1326 ut->chunkLength = 0;
1328 ut->chunkNativeStart = 0;
1329 ut->chunkNativeLimit = 0;
1331 ut->chunkNativeStart = length;
1332 ut->chunkNativeLimit = length;
1363 openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status) {
1364 ut = utext_openUnicodeString(ut, s, status);
1366 return ut;
1371 memcpy(&fragmentFuncs, ut->pFuncs, sizeof(fragmentFuncs));
1374 ut->pFuncs = &fragmentFuncs;
1376 ut->chunkContents = (UChar *)&ut->b;
1377 ut->pFuncs->access(ut, 0, TRUE);
1378 return ut;
1432 UText *ut = utext_openUChars(NULL, s, -1, &status);
1434 utext_setNativeIndex(ut, 0);
1437 int64_t nativeIndex = UTEXT_GETNATIVEINDEX(ut);
1439 while ((c = utext_next32(ut)) != U_SENTINEL) {
1446 nativeIndex = UTEXT_GETNATIVEINDEX(ut);
1450 nativeIndex = UTEXT_GETNATIVEINDEX(ut);
1452 utext_close(ut);