Home | History | Annotate | Download | only in ustring

Lines Matching refs:buffer

151     UChar buffer[32];
156 buffer[0]=0; /* empty, NUL-terminated string */
157 u_strncat(buffer, text, 1); /* append just n=1 character ('A') */
158 u_strcat(buffer, appendText); /* buffer=="Aabc" */
159 length=u_strlen(buffer); /* length=4 */
160 printUString("should be \"Aabc\": ", buffer, -1);
162 /* bitwise comparing buffer with text */
163 compare=u_strcmp(buffer, text);
168 /* Build "A<sharp s>C" in the buffer... */
169 u_strcpy(buffer, text);
170 buffer[1]=0xdf; /* sharp s, case-compares equal to "ss" */
171 printUString("should be \"A<sharp s>C\": ", buffer, -1);
174 compare=u_strcasecmp(buffer, cmpText, U_FOLD_CASE_DEFAULT);
196 UChar buffer[32];
217 for(i=j=0; j<LENGTHOF(buffer) && !isError; /* U16_NEXT post-increments */) {
220 break; /* stop at terminating NUL, no need to terminate buffer */
223 U16_APPEND(buffer, j, LENGTHOF(buffer), c, isError);
225 printUString("simple-uppercased: ", buffer, j);
228 for(i=j=0; j<LENGTHOF(buffer) && !isError; /* U16_NEXT post-increments */) {
231 break; /* stop at terminating NUL, no need to terminate buffer */
234 U16_APPEND(buffer, j, LENGTHOF(buffer), c, isError);
236 printUString("simple-lowercased: ", buffer, j);
239 for(i=j=0; j<LENGTHOF(buffer) && !isError; /* U16_NEXT post-increments */) {
242 break; /* stop at terminating NUL, no need to terminate buffer */
245 U16_APPEND(buffer, j, LENGTHOF(buffer), c, isError);
247 printUString("simple-titlecased: ", buffer, j);
250 for(i=j=0; j<LENGTHOF(buffer) && !isError; /* U16_NEXT post-increments */) {
253 break; /* stop at terminating NUL, no need to terminate buffer */
256 U16_APPEND(buffer, j, LENGTHOF(buffer), c, isError);
258 printUString("simple-case-folded/default: ", buffer, j);
261 for(i=j=0; j<LENGTHOF(buffer) && !isError; /* U16_NEXT post-increments */) {
264 break; /* stop at terminating NUL, no need to terminate buffer */
267 U16_APPEND(buffer, j, LENGTHOF(buffer), c, isError);
269 printUString("simple-case-folded/Turkic: ", buffer, j);
288 length=u_strToLower(buffer, LENGTHOF(buffer), input, -1, "en", &errorCode);
290 printUString("full-lowercased/en: ", buffer, length);
296 length=u_strToLower(buffer, LENGTHOF(buffer), input, -1, "tr", &errorCode);
298 printUString("full-lowercased/tr: ", buffer, length);
304 length=u_strToUpper(buffer, LENGTHOF(buffer), input, -1, "en", &errorCode);
306 printUString("full-uppercased/en: ", buffer, length);
312 length=u_strToUpper(buffer, LENGTHOF(buffer), input, -1, "tr", &errorCode);
314 printUString("full-uppercased/tr: ", buffer, length);
320 length=u_strToTitle(buffer, LENGTHOF(buffer), input, -1, NULL, "en", &errorCode);
322 printUString("full-titlecased/en: ", buffer, length);
328 length=u_strToTitle(buffer, LENGTHOF(buffer), input, -1, NULL, "tr", &errorCode);
330 printUString("full-titlecased/tr: ", buffer, length);
336 length=u_strFoldCase(buffer, LENGTHOF(buffer), input, -1, U_FOLD_CASE_DEFAULT, &errorCode);
338 printUString("full-case-folded/default: ", buffer, length);
344 length=u_strFoldCase(buffer, LENGTHOF(buffer), input, -1, U_FOLD_CASE_EXCLUDE_SPECIAL_I, &errorCode);
346 printUString("full-case-folded/Turkic: ", buffer, length);
434 // build a longer string that will not fit into the object's buffer
439 buffer and increment the reference
445 // construct a string that aliases a readonly buffer
449 // a copy to either the internal buffer or to a newly allocated one
454 printf("readonly buffer[%d] after modifying its string: 0x%lx\n",
460 // will readonly-alias the same buffer
463 printf("verify that a fastCopyFrom(readonly alias) uses the same buffer pointer: %d (should be 1)\n",
467 printf("verify that a regular copy of a readonly alias uses a different buffer pointer: %d (should be 0)\n",
473 // a modification writes through to the buffer
476 printf("writeable-alias backing buffer[%d]=0x%lx "
484 printf("writeable-alias backing buffer[%d]=0x%lx after "
489 // grow the string - it will not fit into the backing buffer any more
499 // if we need it in the original buffer, then extract() to it
500 // extract() does not do anything if the string aliases that same buffer
509 printf("writeable-alias backing buffer[%d]=0x%lx after re-extract\n",
567 UChar buffer[200];
571 buffer, LENGTHOF(buffer));
573 printUnicodeString("", UnicodeString(buffer));