1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ustring.h,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _RTL_USTRING_H_
32 #define _RTL_USTRING_H_
34 #include <sal/types.h>
35 #include <osl/interlck.h>
36 #include <rtl/string.h>
37 #include <rtl/textenc.h>
43 /* ======================================================================= */
45 /** Return the length of a string.
47 The length is equal to the number of 16-bit Unicode characters in the
48 string, without the terminating NUL character.
51 a null-terminated string.
54 the length of the sequence of characters represented by this string,
55 excluding the terminating NUL character.
57 sal_Int32 SAL_CALL
rtl_ustr_getLength( const sal_Unicode
* str
) SAL_THROW_EXTERN_C();
59 /** Compare two strings.
61 The comparison is based on the numeric value of each character in the
62 strings and returns a value indicating their relationship. This function
63 cannot be used for language-specific sorting. Both strings must be
67 the first null-terminated string to be compared.
70 the second null-terminated string which is compared with the first one.
73 0 if both strings are equal, a value less than 0 if the first string is
74 less than the second string, and a value greater than 0 if the first
75 string is greater than the second string.
77 sal_Int32 SAL_CALL
rtl_ustr_compare( const sal_Unicode
* first
, const sal_Unicode
* second
) SAL_THROW_EXTERN_C();
79 /** Compare two strings.
81 The comparison is based on the numeric value of each character in the
82 strings and returns a value indicating their relationship. This function
83 cannot be used for language-specific sorting.
86 the first string to be compared. Need not be null-terminated, but must be
87 at least as long as the specified firstLen.
90 the length of the first string.
93 the second string which is compared with the first one. Need not be
94 null-terminated, but must be at least as long as the specified secondLen.
97 the length of the second string.
100 0 if both strings are equal, a value less than 0 if the first string is
101 less than the second string, and a value greater than 0 if the first
102 string is greater than the second string.
104 sal_Int32 SAL_CALL
rtl_ustr_compare_WithLength( const sal_Unicode
* first
, sal_Int32 firstLen
, const sal_Unicode
* second
, sal_Int32 secondLen
) SAL_THROW_EXTERN_C();
106 /** Compare two strings with a maximum count of characters.
108 The comparison is based on the numeric value of each character in the
109 strings and returns a value indicating their relationship. This function
110 cannot be used for language-specific sorting.
113 the first string to be compared. Need not be null-terminated, but must be
114 at least as long as the specified firstLen.
117 the length of the first string.
120 the second string which is compared with the first one. Need not be
121 null-terminated, but must be at least as long as the specified secondLen.
124 the length of the second string.
127 the maximum number of characters to compare. This length can be greater
128 or smaller than the lengths of the two strings.
131 0 if both substrings are equal, a value less than 0 if the first substring
132 is less than the second substring, and a value greater than 0 if the first
133 substring is greater than the second substring.
135 sal_Int32 SAL_CALL
rtl_ustr_shortenedCompare_WithLength( const sal_Unicode
* first
, sal_Int32 firstLen
, const sal_Unicode
* second
, sal_Int32 secondLen
, sal_Int32 shortenedLen
) SAL_THROW_EXTERN_C();
137 /** Compare two strings from back to front.
139 The comparison is based on the numeric value of each character in the
140 strings and returns a value indicating their relationship. This function
141 cannot be used for language-specific sorting.
144 the first string to be compared. Need not be null-terminated, but must be
145 at least as long as the specified firstLen.
148 the length of the first string.
151 the second string which is compared with the first one. Need not be
152 null-terminated, but must be at least as long as the specified secondLen.
155 the length of the second string.
158 0 if both strings are equal, a value less than 0 if the first string
159 compares less than the second string, and a value greater than 0 if the
160 first string compares greater than the second string.
162 sal_Int32 SAL_CALL
rtl_ustr_reverseCompare_WithLength( const sal_Unicode
* first
, sal_Int32 firstLen
, const sal_Unicode
* second
, sal_Int32 secondLen
) SAL_THROW_EXTERN_C();
164 /** Compare two strings from back to front for equality.
166 The comparison is based on the numeric value of each character in the
167 strings and returns 'true' if, ans only if, both strings are equal.
168 This function cannot be used for language-specific sorting.
171 the first string to be compared. Need not be null-terminated, but must be
172 at least as long as the specified len.
175 the second string which is compared with the first one. Need not be
176 null-terminated, but must be at least as long as the specified len.
179 the length of both strings.
182 true if both strings are equal, false if they are not equal.
185 sal_Bool SAL_CALL
rtl_ustr_asciil_reverseEquals_WithLength( const sal_Unicode
* first
, const sal_Char
* second
, sal_Int32 len
) SAL_THROW_EXTERN_C();
187 /** Compare two strings, ignoring the case of ASCII characters.
189 The comparison is based on the numeric value of each character in the
190 strings and returns a value indicating their relationship. Character
191 values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
192 and 122 (ASCII a--z). This function cannot be used for language-specific
193 sorting. Both strings must be null-terminated.
196 the first null-terminated string to be compared.
199 the second null-terminated string which is compared with the first one.
202 0 if both strings are equal, a value less than 0 if the first string is
203 less than the second string, and a value greater than 0 if the first
204 string is greater than the second string.
206 sal_Int32 SAL_CALL
rtl_ustr_compareIgnoreAsciiCase( const sal_Unicode
* first
, const sal_Unicode
* second
) SAL_THROW_EXTERN_C();
208 /** Compare two strings, ignoring the case of ASCII characters.
210 The comparison is based on the numeric value of each character in the
211 strings and returns a value indicating their relationship. Character
212 values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
213 and 122 (ASCII a--z). This function cannot be used for language-specific
217 the first string to be compared. Need not be null-terminated, but must be
218 at least as long as the specified firstLen.
221 the length of the first string.
224 the second string which is compared with the first one. Need not be
225 null-terminated, but must be at least as long as the specified secondLen.
228 the length of the second string.
231 0 if both strings are equal, a value less than 0 if the first string is
232 less than the second string, and a value greater than 0 if the first
233 string is greater than the second string.
235 sal_Int32 SAL_CALL
rtl_ustr_compareIgnoreAsciiCase_WithLength( const sal_Unicode
* first
, sal_Int32 firstLen
, const sal_Unicode
* second
, sal_Int32 secondLen
) SAL_THROW_EXTERN_C();
237 /** Compare two strings with a maximum count of characters, ignoring the case
240 The comparison is based on the numeric value of each character in the
241 strings and returns a value indicating their relationship. Character
242 values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
243 and 122 (ASCII a--z). This function cannot be used for language-specific
247 the first string to be compared. Need not be null-terminated, but must be
248 at least as long as the specified firstLen.
251 the length of the first string.
254 the second string which is compared with the first one. Need not be
255 null-terminated, but must be at least as long as the specified secondLen.
258 the length of the second string.
261 the maximum number of characters to compare. This length can be greater
262 or smaller than the lengths of the two strings.
265 0 if both substrings are equal, a value less than 0 if the first substring
266 is less than the second substring, and a value greater than 0 if the first
267 substring is greater than the second substring.
269 sal_Int32 SAL_CALL
rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( const sal_Unicode
* first
, sal_Int32 firstLen
, const sal_Unicode
* second
, sal_Int32 secondLen
, sal_Int32 shortenedLen
) SAL_THROW_EXTERN_C();
271 /** Compare two strings.
273 The comparison is based on the numeric value of each character in the
274 strings and returns a value indicating their relationship. This function
275 cannot be used for language-specific sorting. Both strings must be
278 Since this function is optimized for performance, the ASCII character
279 values are not converted in any way. The caller has to make sure that
280 all ASCII characters are in the allowed range of 0 and 127, inclusive.
283 the first null-terminated string to be compared.
286 the second null-terminated ASCII string which is compared with the first
290 0 if both substrings are equal, a value less than 0 if the first substring
291 is less than the second substring, and a value greater than 0 if the first
292 substring is greater than the second substring.
294 sal_Int32 SAL_CALL
rtl_ustr_ascii_compare( const sal_Unicode
* first
, const sal_Char
* second
) SAL_THROW_EXTERN_C();
296 /** Compare two strings.
298 The comparison is based on the numeric value of each character in the
299 strings and returns a value indicating their relationship. This function
300 cannot be used for language-specific sorting.
302 Since this function is optimized for performance, the ASCII character
303 values are not converted in any way. The caller has to make sure that
304 all ASCII characters are in the allowed range of 0 and 127, inclusive.
307 the first string to be compared. Need not be null-terminated, but must be
308 at least as long as the specified firstLen.
311 the length of the first string.
314 the second null-terminated ASCII string which is compared with the first
318 0 if both substrings are equal, a value less than 0 if the first substring
319 is less than the second substring, and a value greater than 0 if the first
320 substring is greater than the second substring.
322 sal_Int32 SAL_CALL
rtl_ustr_ascii_compare_WithLength( const sal_Unicode
* first
, sal_Int32 firstLen
, const sal_Char
* second
) SAL_THROW_EXTERN_C();
324 /** Compare two strings with a maximum count of characters.
326 The comparison is based on the numeric value of each character in the
327 strings and returns a value indicating their relationship. This function
328 cannot be used for language-specific sorting.
330 Since this function is optimized for performance, the ASCII character
331 values are not converted in any way. The caller has to make sure that
332 all ASCII characters are in the allowed range of 0 and 127, inclusive.
335 the first string to be compared. Need not be null-terminated, but must be
336 at least as long as the specified firstLen.
339 the length of the first string.
342 the second null-terminated ASCII string which is compared with the first
346 the maximum number of characters to compare. This length can be greater
347 or smaller than the lengths of the two strings.
350 0 if both substrings are equal, a value less than 0 if the first substring
351 is less than the second substring, and a value greater than 0 if the first
352 substring is greater than the second substring.
354 sal_Int32 SAL_CALL
rtl_ustr_ascii_shortenedCompare_WithLength( const sal_Unicode
* first
, sal_Int32 firstLen
, const sal_Char
* second
, sal_Int32 shortenedLen
) SAL_THROW_EXTERN_C();
356 /** Compare two strings from back to front.
358 The comparison is based on the numeric value of each character in the
359 strings and returns a value indicating their relationship. This function
360 cannot be used for language-specific sorting.
362 Since this function is optimized for performance, the ASCII character
363 values are not converted in any way. The caller has to make sure that
364 all ASCII characters are in the allowed range of 0 and 127, inclusive.
367 the first string to be compared. Need not be null-terminated, but must be
368 at least as long as the specified firstLen.
371 the length of the first string.
374 the second ASCII string which is compared with the first one. Need not be
375 null-terminated, but must be at least as long as the specified secondLen.
378 the length of the second string.
381 0 if both strings are equal, a value less than 0 if the first string
382 compares less than the second string, and a value greater than 0 if the
383 first string compares greater than the second string.
385 sal_Int32 SAL_CALL
rtl_ustr_asciil_reverseCompare_WithLength( const sal_Unicode
* first
, sal_Int32 firstLen
, const sal_Char
* second
, sal_Int32 secondLen
) SAL_THROW_EXTERN_C();
387 /** Compare two strings, ignoring the case of ASCII characters.
389 The comparison is based on the numeric value of each character in the
390 strings and returns a value indicating their relationship. Character
391 values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
392 and 122 (ASCII a--z). This function cannot be used for language-specific
393 sorting. Both strings must be null-terminated.
395 Since this function is optimized for performance, the ASCII character
396 values are not converted in any way. The caller has to make sure that
397 all ASCII characters are in the allowed range of 0 and 127, inclusive.
400 the first null-terminated string to be compared.
403 the second null-terminated ASCII string which is compared with the first
407 0 if both strings are equal, a value less than 0 if the first string is
408 less than the second string, and a value greater than 0 if the first
409 string is greater than the second string.
411 sal_Int32 SAL_CALL
rtl_ustr_ascii_compareIgnoreAsciiCase( const sal_Unicode
* first
, const sal_Char
* second
) SAL_THROW_EXTERN_C();
413 /** Compare two strings, ignoring the case of ASCII characters.
415 The comparison is based on the numeric value of each character in the
416 strings and returns a value indicating their relationship. Character
417 values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
418 and 122 (ASCII a--z). This function cannot be used for language-specific
421 Since this function is optimized for performance, the ASCII character
422 values are not converted in any way. The caller has to make sure that
423 all ASCII characters are in the allowed range of 0 and 127, inclusive.
426 the first string to be compared. Need not be null-terminated, but must be
427 at least as long as the specified firstLen.
430 the length of the first string.
433 the second null-terminated ASCII string which is compared with the first
437 0 if both strings are equal, a value less than 0 if the first string is
438 less than the second string, and a value greater than 0 if the first
439 string is greater than the second string.
441 sal_Int32 SAL_CALL
rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( const sal_Unicode
* first
, sal_Int32 firstLen
, const sal_Char
* second
) SAL_THROW_EXTERN_C();
443 /** Compare two strings, ignoring the case of ASCII characters.
445 The comparison is based on the numeric value of each character in the
446 strings and returns a value indicating their relationship. Character
447 values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
448 and 122 (ASCII a--z). This function cannot be used for language-specific
451 Since this function is optimized for performance, the ASCII character
452 values are not converted in any way. The caller has to make sure that
453 all ASCII characters are in the allowed range of 0 and 127, inclusive.
456 the first string to be compared. Need not be null-terminated, but must be
457 at least as long as the specified firstLen.
460 the length of the first string.
463 the second string which is compared with the first one. Need not be
464 null-terminated, but must be at least as long as the specified secondLen.
467 the length of the second string.
470 0 if both strings are equal, a value less than 0 if the first string is
471 less than the second string, and a value greater than 0 if the first
472 string is greater than the second string.
474 sal_Int32 SAL_CALL
rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
475 sal_Unicode
const * first
, sal_Int32 firstLen
,
476 char const * second
, sal_Int32 secondLen
) SAL_THROW_EXTERN_C();
478 /** Compare two strings with a maximum count of characters, ignoring the case
481 The comparison is based on the numeric value of each character in the
482 strings and returns a value indicating their relationship. Character
483 values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
484 and 122 (ASCII a--z). This function cannot be used for language-specific
487 Since this function is optimized for performance, the ASCII character
488 values are not converted in any way. The caller has to make sure that
489 all ASCII characters are in the allowed range of 0 and 127, inclusive.
492 the first string to be compared. Need not be null-terminated, but must be
493 at least as long as the specified firstLen.
496 the length of the first string.
499 the second null-terminated ASCII string which is compared with the first
503 the maximum number of characters to compare. This length can be greater
504 or smaller than the lengths of the two strings.
507 0 if both substrings are equal, a value less than 0 if the first substring
508 is less than the second substring, and a value greater than 0 if the first
509 substring is greater than the second substring.
511 sal_Int32 SAL_CALL
rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( const sal_Unicode
* first
, sal_Int32 firstLen
, const sal_Char
* second
, sal_Int32 shortenedLen
) SAL_THROW_EXTERN_C();
513 /** Return a hash code for a string.
515 It is not allowed to store the hash code persistently, because later
516 versions could return other hash codes. The string must be
520 a null-terminated string.
523 a hash code for the given string.
525 sal_Int32 SAL_CALL
rtl_ustr_hashCode( const sal_Unicode
* str
) SAL_THROW_EXTERN_C();
527 /** Return a hash code for a string.
529 It is not allowed to store the hash code persistently, because later
530 versions could return other hash codes.
533 a string. Need not be null-terminated, but must be at least as long as
537 the length of the string.
540 a hash code for the given string.
542 sal_Int32 SAL_CALL
rtl_ustr_hashCode_WithLength( const sal_Unicode
* str
, sal_Int32 len
) SAL_THROW_EXTERN_C();
544 /** Search for the first occurrence of a character within a string.
546 The string must be null-terminated.
549 a null-terminated string.
552 the character to be searched for.
555 the index (starting at 0) of the first occurrence of the character in the
556 string, or -1 if the character does not occur.
558 sal_Int32 SAL_CALL
rtl_ustr_indexOfChar( const sal_Unicode
* str
, sal_Unicode ch
) SAL_THROW_EXTERN_C();
560 /** Search for the first occurrence of a character within a string.
563 a string. Need not be null-terminated, but must be at least as long as
567 the length of the string.
570 the character to be searched for.
573 the index (starting at 0) of the first occurrence of the character in the
574 string, or -1 if the character does not occur.
576 sal_Int32 SAL_CALL
rtl_ustr_indexOfChar_WithLength( const sal_Unicode
* str
, sal_Int32 len
, sal_Unicode ch
) SAL_THROW_EXTERN_C();
578 /** Search for the last occurrence of a character within a string.
580 The string must be null-terminated.
583 a null-terminated string.
586 the character to be searched for.
589 the index (starting at 0) of the last occurrence of the character in the
590 string, or -1 if the character does not occur. The returned value is
591 always smaller than the string length.
593 sal_Int32 SAL_CALL
rtl_ustr_lastIndexOfChar( const sal_Unicode
* str
, sal_Unicode ch
) SAL_THROW_EXTERN_C();
595 /** Search for the last occurrence of a character within a string.
598 a string. Need not be null-terminated, but must be at least as long as
602 the length of the string.
605 the character to be searched for.
608 the index (starting at 0) of the last occurrence of the character in the
609 string, or -1 if the character does not occur. The returned value is
610 always smaller than the string length.
612 sal_Int32 SAL_CALL
rtl_ustr_lastIndexOfChar_WithLength( const sal_Unicode
* str
, sal_Int32 len
, sal_Unicode ch
) SAL_THROW_EXTERN_C();
614 /** Search for the first occurrence of a substring within a string.
616 If subStr is empty, or both str and subStr are empty, -1 is returned.
617 Both strings must be null-terminated.
620 a null-terminated string.
623 the null-terminated substring to be searched for.
626 the index (starting at 0) of the first character of the first occurrence
627 of the substring within the string, or -1 if the substring does not occur.
629 sal_Int32 SAL_CALL
rtl_ustr_indexOfStr( const sal_Unicode
* str
, const sal_Unicode
* subStr
) SAL_THROW_EXTERN_C();
631 /** Search for the first occurrence of a substring within a string.
633 If subStr is empty, or both str and subStr are empty, -1 is returned.
636 a string. Need not be null-terminated, but must be at least as long as
640 the length of the string.
643 the substring to be searched for. Need not be null-terminated, but must
644 be at least as long as the specified subLen.
647 the length of the substring.
650 the index (starting at 0) of the first character of the first occurrence
651 of the substring within the string, or -1 if the substring does not occur.
653 sal_Int32 SAL_CALL
rtl_ustr_indexOfStr_WithLength( const sal_Unicode
* str
, sal_Int32 len
, const sal_Unicode
* subStr
, sal_Int32 subLen
) SAL_THROW_EXTERN_C();
655 /** Search for the first occurrence of an ASCII substring within a string.
658 a string. Need not be null-terminated, but must be at least as long as
662 the length of the string; must be non-negative.
665 the substring to be searched for. Need not be null-terminated, but must
666 be at least as long as the specified subLen. Must only contain characters
667 in the ASCII range 0x00--7F.
670 the length of the substring; must be non-negative.
673 the index (starting at 0) of the first character of the first occurrence
674 of the substring within the string, or -1 if the substring does not occur.
675 If subLen is zero, -1 is returned.
679 sal_Int32 SAL_CALL
rtl_ustr_indexOfAscii_WithLength(
680 sal_Unicode
const * str
, sal_Int32 len
,
681 char const * subStr
, sal_Int32 subLen
) SAL_THROW_EXTERN_C();
683 /** Search for the last occurrence of a substring within a string.
685 If subStr is empty, or both str and subStr are empty, -1 is returned.
686 Both strings must be null-terminated.
689 a null-terminated string.
692 the null-terminated substring to be searched for.
695 the index (starting at 0) of the first character of the last occurrence
696 of the substring within the string, or -1 if the substring does not occur.
698 sal_Int32 SAL_CALL
rtl_ustr_lastIndexOfStr( const sal_Unicode
* str
, const sal_Unicode
* subStr
) SAL_THROW_EXTERN_C();
700 /** Search for the last occurrence of a substring within a string.
702 If subStr is empty, or both str and subStr are empty, -1 is returned.
705 a string. Need not be null-terminated, but must be at least as long as
709 the length of the string.
712 the substring to be searched for. Need not be null-terminated, but must
713 be at least as long as the specified subLen.
716 the length of the substring.
719 the index (starting at 0) of the first character of the first occurrence
720 of the substring within the string, or -1 if the substring does not occur.
722 sal_Int32 SAL_CALL
rtl_ustr_lastIndexOfStr_WithLength( const sal_Unicode
* str
, sal_Int32 len
, const sal_Unicode
* subStr
, sal_Int32 subLen
) SAL_THROW_EXTERN_C();
724 /** Search for the last occurrence of an ASCII substring within a string.
727 a string. Need not be null-terminated, but must be at least as long as
731 the length of the string; must be non-negative.
734 the substring to be searched for. Need not be null-terminated, but must
735 be at least as long as the specified subLen. Must only contain characters
736 in the ASCII range 0x00--7F.
739 the length of the substring; must be non-negative.
742 the index (starting at 0) of the first character of the last occurrence
743 of the substring within the string, or -1 if the substring does not occur.
744 If subLen is zero, -1 is returned.
748 sal_Int32 SAL_CALL
rtl_ustr_lastIndexOfAscii_WithLength(
749 sal_Unicode
const * str
, sal_Int32 len
,
750 char const * subStr
, sal_Int32 subLen
) SAL_THROW_EXTERN_C();
752 /** Replace all occurrences of a single character within a string.
754 If oldChar does not occur within str, then the string is not modified.
755 The string must be null-terminated.
758 a null-terminated string.
766 void SAL_CALL
rtl_ustr_replaceChar( sal_Unicode
* str
, sal_Unicode oldChar
, sal_Unicode newChar
) SAL_THROW_EXTERN_C();
768 /** Replace all occurrences of a single character within a string.
770 If oldChar does not occur within str, then the string is not modified.
773 a string. Need not be null-terminated, but must be at least as long as
777 the length of the string.
785 void SAL_CALL
rtl_ustr_replaceChar_WithLength( sal_Unicode
* str
, sal_Int32 len
, sal_Unicode oldChar
, sal_Unicode newChar
) SAL_THROW_EXTERN_C();
787 /** Convert all ASCII uppercase letters to lowercase within a string.
789 The characters with values between 65 and 90 (ASCII A--Z) are replaced
790 with values between 97 and 122 (ASCII a--z). The string must be
794 a null-terminated string.
796 void SAL_CALL
rtl_ustr_toAsciiLowerCase( sal_Unicode
* str
) SAL_THROW_EXTERN_C();
798 /** Convert all ASCII uppercase letters to lowercase within a string.
800 The characters with values between 65 and 90 (ASCII A--Z) are replaced
801 with values between 97 and 122 (ASCII a--z).
804 a string. Need not be null-terminated, but must be at least as long as
808 the length of the string.
810 void SAL_CALL
rtl_ustr_toAsciiLowerCase_WithLength( sal_Unicode
* str
, sal_Int32 len
) SAL_THROW_EXTERN_C();
812 /** Convert all ASCII lowercase letters to uppercase within a string.
814 The characters with values between 97 and 122 (ASCII a--z) are replaced
815 with values between 65 and 90 (ASCII A--Z). The string must be
819 a null-terminated string.
821 void SAL_CALL
rtl_ustr_toAsciiUpperCase( sal_Unicode
* str
) SAL_THROW_EXTERN_C();
823 /** Convert all ASCII lowercase letters to uppercase within a string.
825 The characters with values between 97 and 122 (ASCII a--z) are replaced
826 with values between 65 and 90 (ASCII A--Z).
829 a string. Need not be null-terminated, but must be at least as long as
833 the length of the string.
835 void SAL_CALL
rtl_ustr_toAsciiUpperCase_WithLength( sal_Unicode
* str
, sal_Int32 len
) SAL_THROW_EXTERN_C();
837 /** Remove white space from both ends of a string.
839 All characters with values less than or equal to 32 (the space character)
840 are considered to be white space. This function cannot be used for
841 language-specific operations. The string must be null-terminated.
844 a null-terminated string.
847 the new length of the string.
849 sal_Int32 SAL_CALL
rtl_ustr_trim( sal_Unicode
* str
) SAL_THROW_EXTERN_C();
851 /** Remove white space from both ends of the string.
853 All characters with values less than or equal to 32 (the space character)
854 are considered to be white space. This function cannot be used for
855 language-specific operations. The string must be null-terminated.
858 a string. Need not be null-terminated, but must be at least as long as
862 the original length of the string.
865 the new length of the string.
867 sal_Int32 SAL_CALL
rtl_ustr_trim_WithLength( sal_Unicode
* str
, sal_Int32 len
) SAL_THROW_EXTERN_C();
869 /** Create the string representation of a boolean.
871 If b is true, the buffer is filled with the string "true" and 5 is
872 returned. If b is false, the buffer is filled with the string "false" and
873 6 is returned. This function cannot be used for language-specific
877 a buffer that is big enough to hold the result and the terminating NUL
878 character. You should use the RTL_USTR_MAX_VALUEOFBOOLEAN define to
879 create a buffer that is big enough.
885 the length of the string.
887 sal_Int32 SAL_CALL
rtl_ustr_valueOfBoolean( sal_Unicode
* str
, sal_Bool b
) SAL_THROW_EXTERN_C();
888 #define RTL_USTR_MAX_VALUEOFBOOLEAN RTL_STR_MAX_VALUEOFBOOLEAN
890 /** Create the string representation of a character.
893 a buffer that is big enough to hold the result and the terminating NUL
894 character. You should use the RTL_USTR_MAX_VALUEOFCHAR define to create a
895 buffer that is big enough.
901 the length of the string.
903 sal_Int32 SAL_CALL
rtl_ustr_valueOfChar( sal_Unicode
* str
, sal_Unicode ch
) SAL_THROW_EXTERN_C();
904 #define RTL_USTR_MAX_VALUEOFCHAR RTL_STR_MAX_VALUEOFCHAR
906 /** Create the string representation of an integer.
908 This function cannot be used for language-specific operations.
911 a buffer that is big enough to hold the result and the terminating NUL
912 character. You should use the RTL_USTR_MAX_VALUEOFINT32 define to create
913 a buffer that is big enough.
919 the radix. Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
923 the length of the string.
925 sal_Int32 SAL_CALL
rtl_ustr_valueOfInt32( sal_Unicode
* str
, sal_Int32 i
, sal_Int16 radix
) SAL_THROW_EXTERN_C();
926 #define RTL_USTR_MIN_RADIX RTL_STR_MIN_RADIX
927 #define RTL_USTR_MAX_RADIX RTL_STR_MAX_RADIX
928 #define RTL_USTR_MAX_VALUEOFINT32 RTL_STR_MAX_VALUEOFINT32
930 /** Create the string representation of a long integer.
932 This function cannot be used for language-specific operations.
935 a buffer that is big enough to hold the result and the terminating NUL
936 character. You should use the RTL_USTR_MAX_VALUEOFINT64 define to create
937 a buffer that is big enough.
940 a long integer value.
943 the radix. Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
947 the length of the string.
949 sal_Int32 SAL_CALL
rtl_ustr_valueOfInt64( sal_Unicode
* str
, sal_Int64 l
, sal_Int16 radix
) SAL_THROW_EXTERN_C();
950 #define RTL_USTR_MAX_VALUEOFINT64 RTL_STR_MAX_VALUEOFINT64
952 /** Create the string representation of a float.
954 This function cannot be used for language-specific conversion.
957 a buffer that is big enough to hold the result and the terminating NUL
958 character. You should use the RTL_USTR_MAX_VALUEOFFLOAT define to create
959 a buffer that is big enough.
965 the length of the string.
967 sal_Int32 SAL_CALL
rtl_ustr_valueOfFloat( sal_Unicode
* str
, float f
) SAL_THROW_EXTERN_C();
968 #define RTL_USTR_MAX_VALUEOFFLOAT RTL_STR_MAX_VALUEOFFLOAT
970 /** Create the string representation of a double.
972 This function cannot be used for language-specific conversion.
975 a buffer that is big enough to hold the result and the terminating NUL
976 character. You should use the RTL_USTR_MAX_VALUEOFDOUBLE define to create
977 a buffer that is big enough.
983 the length of the string.
985 sal_Int32 SAL_CALL
rtl_ustr_valueOfDouble( sal_Unicode
* str
, double d
) SAL_THROW_EXTERN_C();
986 #define RTL_USTR_MAX_VALUEOFDOUBLE RTL_STR_MAX_VALUEOFDOUBLE
988 /** Interpret a string as a boolean.
990 This function cannot be used for language-specific conversion. The string
991 must be null-terminated.
994 a null-terminated string.
997 true if the string is "1" or "true" in any ASCII case, false otherwise.
999 sal_Bool SAL_CALL
rtl_ustr_toBoolean( const sal_Unicode
* str
) SAL_THROW_EXTERN_C();
1001 /** Interpret a string as an integer.
1003 This function cannot be used for language-specific conversion. The string
1004 must be null-terminated.
1007 a null-terminated string.
1010 the radix. Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
1014 the integer value represented by the string, or 0 if the string does not
1015 represent an integer.
1017 sal_Int32 SAL_CALL
rtl_ustr_toInt32( const sal_Unicode
* str
, sal_Int16 radix
) SAL_THROW_EXTERN_C();
1019 /** Interpret a string as a long integer.
1021 This function cannot be used for language-specific conversion. The string
1022 must be null-terminated.
1025 a null-terminated string.
1028 the radix. Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
1032 the long integer value represented by the string, or 0 if the string does
1033 not represent a long integer.
1035 sal_Int64 SAL_CALL
rtl_ustr_toInt64( const sal_Unicode
* str
, sal_Int16 radix
) SAL_THROW_EXTERN_C();
1037 /** Interpret a string as a float.
1039 This function cannot be used for language-specific conversion. The string
1040 must be null-terminated.
1043 a null-terminated string.
1046 the float value represented by the string, or 0.0 if the string does not
1049 float SAL_CALL
rtl_ustr_toFloat( const sal_Unicode
* str
) SAL_THROW_EXTERN_C();
1051 /** Interpret a string as a double.
1053 This function cannot be used for language-specific conversion. The string
1054 must be null-terminated.
1057 a null-terminated string.
1060 the float value represented by the string, or 0.0 if the string does not
1063 double SAL_CALL
rtl_ustr_toDouble( const sal_Unicode
* str
) SAL_THROW_EXTERN_C();
1065 /* ======================================================================= */
1067 #if defined( SAL_W32) || defined(SAL_OS2)
1068 #pragma pack(push, 4)
1071 /** The implementation of a Unicode string.
1075 typedef struct _rtl_uString
1077 oslInterlockedCount refCount
; /* opaque */
1079 sal_Unicode buffer
[1];
1082 #if defined( SAL_W32) || defined(SAL_OS2)
1086 /* ----------------------------------------------------------------------- */
1088 /** Increment the reference count of a string.
1093 void SAL_CALL
rtl_uString_acquire( rtl_uString
* str
) SAL_THROW_EXTERN_C();
1095 /** Decrement the reference count of a string.
1097 If the count goes to zero than the string data is deleted.
1102 void SAL_CALL
rtl_uString_release( rtl_uString
* str
) SAL_THROW_EXTERN_C();
1104 /** Allocate a new string containing no characters.
1107 pointer to the new string. The pointed-to data must be null or a valid
1110 void SAL_CALL
rtl_uString_new( rtl_uString
** newStr
) SAL_THROW_EXTERN_C();
1112 /** Allocate a new string containing space for a given number of characters.
1114 If len is greater than zero, the reference count of the new string will be
1115 1. The values of all characters are set to 0 and the length of the string
1116 is 0. This function does not handle out-of-memory conditions.
1119 pointer to the new string. The pointed-to data must be null or a valid
1123 the number of characters.
1125 void SAL_CALL
rtl_uString_new_WithLength( rtl_uString
** newStr
, sal_Int32 nLen
) SAL_THROW_EXTERN_C();
1127 /** Allocate a new string that contains a copy of another string.
1129 If the length of value is greater than zero, the reference count of the
1130 new string will be 1. This function does not handle out-of-memory
1134 pointer to the new string. The pointed-to data must be null or a valid
1140 void SAL_CALL
rtl_uString_newFromString( rtl_uString
** newStr
, const rtl_uString
* value
) SAL_THROW_EXTERN_C();
1142 /** Allocate a new string that contains a copy of a character array.
1144 If the length of value is greater than zero, the reference count of the
1145 new string will be 1. This function does not handle out-of-memory
1149 pointer to the new string. The pointed-to data must be null or a valid
1153 a null-terminated character array.
1155 void SAL_CALL
rtl_uString_newFromStr( rtl_uString
** newStr
, const sal_Unicode
* value
) SAL_THROW_EXTERN_C();
1157 /** Allocate a new string that contains a copy of a character array.
1159 If the length of value is greater than zero, the reference count of the
1160 new string will be 1. This function does not handle out-of-memory
1164 pointer to the new string. The pointed-to data must be null or a valid
1168 a character array. Need not be null-terminated, but must be at least as
1169 long as the specified len.
1172 the length of the character array.
1174 void SAL_CALL
rtl_uString_newFromStr_WithLength( rtl_uString
** newStr
, const sal_Unicode
* value
, sal_Int32 len
) SAL_THROW_EXTERN_C();
1176 /** Allocate a new string that contains a copy of a character array.
1178 If the length of value is greater than zero, the reference count of the
1179 new string will be 1. This function does not handle out-of-memory
1182 Since this function is optimized for performance, the ASCII character
1183 values are not converted in any way. The caller has to make sure that
1184 all ASCII characters are in the allowed range of 0 and 127, inclusive.
1187 pointer to the new string. The pointed-to data must be null or a valid
1191 a null-terminated ASCII character array.
1193 void SAL_CALL
rtl_uString_newFromAscii( rtl_uString
** newStr
, const sal_Char
* value
) SAL_THROW_EXTERN_C();
1195 /** Allocate a new string from an array of Unicode code points.
1198 a non-null pointer to a (possibly null) rtl_uString pointer, which (if
1199 non-null) will have been passed to rtl_uString_release before the function
1200 returns. Upon return, points to the newly allocated string or to null if
1201 there was either an out-of-memory condition or the resulting number of
1202 UTF-16 code units would have been larger than SAL_MAX_INT32. The newly
1203 allocated string (if any) must ultimately be passed to rtl_uString_release.
1206 an array of at least codePointCount code points, which each must be in the
1207 range from 0 to 0x10FFFF, inclusive. May be null if codePointCount is zero.
1209 @param codePointCount
1210 the non-negative number of code points.
1214 void SAL_CALL
rtl_uString_newFromCodePoints(
1215 rtl_uString
** newString
, sal_uInt32
const * codePoints
,
1216 sal_Int32 codePointCount
) SAL_THROW_EXTERN_C();
1218 /** Assign a new value to a string.
1220 First releases any value str might currently hold, then acquires
1224 pointer to the string. The pointed-to data must be null or a valid
1230 void SAL_CALL
rtl_uString_assign( rtl_uString
** str
, rtl_uString
* rightValue
) SAL_THROW_EXTERN_C();
1232 /** Return the length of a string.
1234 The length is equal to the number of characters in the string.
1240 the length of the string.
1242 sal_Int32 SAL_CALL
rtl_uString_getLength( const rtl_uString
* str
) SAL_THROW_EXTERN_C();
1244 /** Return a pointer to the underlying character array of a string.
1250 a pointer to the null-terminated character array.
1252 sal_Unicode
* SAL_CALL
rtl_uString_getStr( rtl_uString
* str
) SAL_THROW_EXTERN_C();
1254 /** Create a new string that is the concatenation of two other strings.
1256 The new string does not necessarily have a reference count of 1 (in cases
1257 where one of the two other strings is empty), so it must not be modified
1258 without checking the reference count. This function does not handle
1259 out-of-memory conditions.
1262 pointer to the new string. The pointed-to data must be null or a valid
1271 void SAL_CALL
rtl_uString_newConcat( rtl_uString
** newStr
, rtl_uString
* left
, rtl_uString
* right
) SAL_THROW_EXTERN_C();
1273 /** Create a new string by replacing a substring of another string.
1275 The new string results from replacing a number of characters (count),
1276 starting at the specified position (index) in the original string (str),
1277 with some new substring (subStr). If subStr is null, than only a number
1278 of characters is deleted.
1280 The new string does not necessarily have a reference count of 1, so it
1281 must not be modified without checking the reference count. This function
1282 does not handle out-of-memory conditions.
1285 pointer to the new string. The pointed-to data must be null or a valid
1292 the index into str at which to start replacement. Must be between 0 and
1293 the length of str, inclusive.
1296 the number of charcters to remove. Must not be negative, and the sum of
1297 index and count must not exceed the length of str.
1300 either null or a valid string to be inserted.
1302 void SAL_CALL
rtl_uString_newReplaceStrAt( rtl_uString
** newStr
, rtl_uString
* str
, sal_Int32 idx
, sal_Int32 count
, rtl_uString
* subStr
) SAL_THROW_EXTERN_C();
1304 /** Create a new string by replacing all occurrences of a single character
1305 within another string.
1307 The new string results from replacing all occurrences of oldChar in str
1310 The new string does not necessarily have a reference count of 1 (in cases
1311 where oldChar does not occur in str), so it must not be modified without
1312 checking the reference count. This function does not handle out-of-memory
1316 pointer to the new string. The pointed-to data must be null or a valid
1328 void SAL_CALL
rtl_uString_newReplace( rtl_uString
** newStr
, rtl_uString
* str
, sal_Unicode oldChar
, sal_Unicode newChar
) SAL_THROW_EXTERN_C();
1330 /** Create a new string by converting all ASCII uppercase letters to lowercase
1331 within another string.
1333 The new string results from replacing all characters with values between
1334 65 and 90 (ASCII A--Z) by values between 97 and 122 (ASCII a--z).
1336 This function cannot be used for language-specific conversion. The new
1337 string does not necessarily have a reference count of 1 (in cases where
1338 no characters need to be converted), so it must not be modified without
1339 checking the reference count. This function does not handle out-of-memory
1343 pointer to the new string. The pointed-to data must be null or a valid
1349 void SAL_CALL
rtl_uString_newToAsciiLowerCase( rtl_uString
** newStr
, rtl_uString
* str
) SAL_THROW_EXTERN_C();
1351 /** Create a new string by converting all ASCII lowercase letters to uppercase
1352 within another string.
1354 The new string results from replacing all characters with values between
1355 97 and 122 (ASCII a--z) by values between 65 and 90 (ASCII A--Z).
1357 This function cannot be used for language-specific conversion. The new
1358 string does not necessarily have a reference count of 1 (in cases where
1359 no characters need to be converted), so it must not be modified without
1360 checking the reference count. This function does not handle out-of-memory
1364 pointer to the new string. The pointed-to data must be null or a valid
1370 void SAL_CALL
rtl_uString_newToAsciiUpperCase( rtl_uString
** newStr
, rtl_uString
* str
) SAL_THROW_EXTERN_C();
1372 /** Create a new string by removing white space from both ends of another
1375 The new string results from removing all characters with values less than
1376 or equal to 32 (the space character) form both ends of str.
1378 This function cannot be used for language-specific conversion. The new
1379 string does not necessarily have a reference count of 1 (in cases where
1380 no characters need to be removed), so it must not be modified without
1381 checking the reference count. This function does not handle out-of-memory
1385 pointer to the new string. The pointed-to data must be null or a valid
1391 void SAL_CALL
rtl_uString_newTrim( rtl_uString
** newStr
, rtl_uString
* str
) SAL_THROW_EXTERN_C();
1393 /** Create a new string by extracting a single token from another string.
1395 Starting at index, the token's next token is searched for. If there is no
1396 such token, the result is an empty string. Otherwise, all characters from
1397 the start of that token and up to, but not including the next occurrence
1398 of cTok make up the resulting token. The return value is the position of
1399 the next token, or -1 if no more tokens follow.
1401 Example code could look like
1402 rtl_uString * pToken = NULL;
1403 sal_Int32 nIndex = 0;
1407 nIndex = rtl_uString_getToken(&pToken, pStr, 0, ';', nIndex);
1410 while (nIndex >= 0);
1412 The new string does not necessarily have a reference count of 1, so it
1413 must not be modified without checking the reference count. This function
1414 does not handle out-of-memory conditions.
1417 pointer to the new string. The pointed-to data must be null or a valid
1418 string. If either token or index is negative, an empty token is stored in
1419 newStr (and -1 is returned).
1425 the number of the token to return, starting at index.
1428 the character that seperates the tokens.
1431 the position at which searching for the token starts. Must not be greater
1432 than the length of str.
1435 the index of the next token, or -1 if no more tokens follow.
1437 sal_Int32 SAL_CALL
rtl_uString_getToken( rtl_uString
** newStr
, rtl_uString
* str
, sal_Int32 token
, sal_Unicode cTok
, sal_Int32 idx
) SAL_THROW_EXTERN_C();
1439 /* ======================================================================= */
1441 /** Supply an ASCII string literal together with its length and text encoding.
1443 This macro can be used to compute (some of) the arguments in function calls
1444 like rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("foo")).
1446 @param constAsciiStr
1447 must be an expression of type "(possibly cv-qualified reference to) array of
1448 (possibly cv-qualified) char." Each element of the referenced array must
1449 represent an ASCII value in the range 0x00--0x7F. The last element of the
1450 referenced array is not considered part of the represented ASCII string, and
1451 its value should be 0x00. Depending on where this macro is used, the nature
1452 of the supplied expression might be further restricted.
1454 #define RTL_CONSTASCII_USTRINGPARAM( constAsciiStr ) constAsciiStr, ((sal_Int32)(sizeof(constAsciiStr)-1)), RTL_TEXTENCODING_ASCII_US
1456 /* ======================================================================= */
1458 /* predefined constants for String-Conversion */
1459 #define OSTRING_TO_OUSTRING_CVTFLAGS (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |\
1460 RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |\
1461 RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT)
1463 /* ----------------------------------------------------------------------- */
1465 /** Create a new Unicode string by converting a byte string, using a specific
1468 The lengths of the byte string and the Unicode string may differ (e.g.,
1469 for double-byte encodings, UTF-7, UTF-8).
1471 If the length of the byte string is greater than zero, the reference count
1472 of the new string will be 1.
1474 If an out-of-memory condition occurs, newStr will point to a null pointer
1478 pointer to the new string. The pointed-to data must be null or a valid
1482 a byte character array. Need not be null-terminated, but must be at
1483 least as long as the specified len.
1486 the length of the byte character array.
1489 the text encoding to use for conversion.
1492 flags which control the conversion. Either use
1493 OSTRING_TO_OUSTRING_CVTFLAGS, or see
1494 <http://udk.openoffice.org/cpp/man/spec/textconversion.html> for more
1497 void SAL_CALL
rtl_string2UString( rtl_uString
** newStr
, const sal_Char
* str
, sal_Int32 len
, rtl_TextEncoding encoding
, sal_uInt32 convertFlags
) SAL_THROW_EXTERN_C();
1499 /* ======================================================================= */
1500 /* Interning methods */
1502 /** Return a canonical representation for a string.
1504 A pool of strings, initially empty is maintained privately
1505 by the string class. On invocation, if present in the pool
1506 the original string will be returned. Otherwise this string,
1507 or a copy thereof will be added to the pool and returned.
1510 pointer to the new string. The pointed-to data must be null or a valid
1513 If an out-of-memory condition occurs, newStr will point to a null pointer
1517 pointer to the string to be interned.
1521 void SAL_CALL
rtl_uString_intern( rtl_uString
** newStr
,
1522 rtl_uString
* str
) SAL_THROW_EXTERN_C();
1524 /** Return a canonical representation for a string.
1526 A pool of strings, initially empty is maintained privately
1527 by the string class. On invocation, if present in the pool
1528 the original string will be returned. Otherwise this string,
1529 or a copy thereof will be added to the pool and returned.
1532 pointer to the new string. The pointed-to data must be null or a valid
1535 If an out-of-memory condition occurs, newStr will point to a null pointer
1539 a byte character array. Need not be null-terminated, but must be at
1540 least as long as the specified len.
1543 the length of the byte character array.
1546 the text encoding to use for conversion.
1549 flags which control the conversion. Either use
1550 OSTRING_TO_OUSTRING_CVTFLAGS, or see
1551 <http://udk.openoffice.org/cpp/man/spec/textconversion.html> for more
1555 pointer to return conversion status in, or NULL.
1559 void SAL_CALL
rtl_uString_internConvert( rtl_uString
** newStr
,
1560 const sal_Char
* str
,
1562 rtl_TextEncoding encoding
,
1563 sal_uInt32 convertFlags
,
1564 sal_uInt32
*pInfo
) SAL_THROW_EXTERN_C();
1566 /** Iterate through a string based on code points instead of UTF-16 code units.
1568 See Chapter 3 of The Unicode Standard 5.0 (Addison--Wesley, 2006) for
1569 definitions of the various terms used in this description.
1571 The given string is interpreted as a sequence of zero or more UTF-16 code
1572 units. For each index into this sequence (from zero to one less than the
1573 length of the sequence, inclusive), a code point represented starting at the
1574 given index is computed as follows:
1576 - If the UTF-16 code unit addressed by the index constitutes a well-formed
1577 UTF-16 code unit sequence, the computed code point is the scalar value
1578 encoded by that UTF-16 code unit sequence.
1580 - Otherwise, if the index is at least two UTF-16 code units away from the
1581 end of the sequence, and the sequence of two UTF-16 code units addressed by
1582 the index constitutes a well-formed UTF-16 code unit sequence, the computed
1583 code point is the scalar value encoded by that UTF-16 code unit sequence.
1585 - Otherwise, the computed code point is the UTF-16 code unit addressed by
1586 the index. (This last case catches unmatched surrogates as well as indices
1587 pointing into the middle of surrogate pairs.)
1590 pointer to a valid string; must not be null.
1593 pointer to a UTF-16 based index into the given string; must not be null. On
1594 entry, the index must be in the range from zero to the length of the string
1595 (in UTF-16 code units), inclusive. Upon successful return, the index will
1596 be updated to address the UTF-16 code unit that is the given
1597 incrementCodePoints away from the initial index.
1599 @param incrementCodePoints
1600 the number of code points to move the given *indexUtf16. If non-negative,
1601 moving is done after determining the code point at the index. If negative,
1602 moving is done before determining the code point at the (then updated)
1603 index. The value must be such that the resulting UTF-16 based index is in
1604 the range from zero to the length of the string (in UTF-16 code units),
1608 the code point (an integer in the range from 0 to 0x10FFFF, inclusive) that
1609 is represented within the string starting at the index computed as follows:
1610 If incrementCodePoints is non-negative, the index is the initial value of
1611 *indexUtf16; if incrementCodePoints is negative, the index is the updated
1612 value of *indexUtf16. In either case, the computed index must be in the
1613 range from zero to one less than the length of the string (in UTF-16 code
1618 sal_uInt32 SAL_CALL
rtl_uString_iterateCodePoints(
1619 rtl_uString
const * string
, sal_Int32
* indexUtf16
,
1620 sal_Int32 incrementCodePoints
);
1622 /** Converts a byte string to a Unicode string, signalling failure.
1625 An out parameter receiving the converted string. Must not be null itself,
1626 and must contain either null or a pointer to a valid rtl_uString; the
1627 contents are unspecified if conversion fails (rtl_convertStringToUString
1631 The byte string. May only be null if length is zero.
1634 The length of the byte string. Must be non-negative.
1637 The text encoding to convert from. Must be an octet encoding (i.e.,
1638 rtl_isOctetTextEncoding(encoding) must return true).
1641 A combination of RTL_TEXTTOUNICODE_FLAGS that detail how to do the
1642 conversion (see rtl_convertTextToUnicode). RTL_TEXTTOUNICODE_FLAGS_FLUSH
1643 need not be included, it is implicitly assumed. Typical uses are either
1644 RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
1645 RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
1646 RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR (fail if a byte or multi-byte sequence
1647 cannot be converted from the source encoding) or
1648 OSTRING_TO_OUSTRING_CVTFLAGS (make a best efforts conversion).
1651 True if the conversion succeeded, false otherwise.
1655 sal_Bool SAL_CALL
rtl_convertStringToUString(
1656 rtl_uString
** target
, char const * source
, sal_Int32 length
,
1657 rtl_TextEncoding encoding
, sal_uInt32 flags
) SAL_THROW_EXTERN_C();
1663 #endif /* _RTL_USTRING_H_ */