xref: /aoo4110/main/sal/inc/rtl/ustring.h (revision b1cdbd2c)
1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski  *
3*b1cdbd2cSJim Jagielski  * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski  * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski  * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski  * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski  * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski  * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski  * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski  *
11*b1cdbd2cSJim Jagielski  *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski  *
13*b1cdbd2cSJim Jagielski  * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski  * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski  * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski  * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski  * under the License.
19*b1cdbd2cSJim Jagielski  *
20*b1cdbd2cSJim Jagielski  *************************************************************/
21*b1cdbd2cSJim Jagielski 
22*b1cdbd2cSJim Jagielski 
23*b1cdbd2cSJim Jagielski 
24*b1cdbd2cSJim Jagielski #ifndef _RTL_USTRING_H_
25*b1cdbd2cSJim Jagielski #define _RTL_USTRING_H_
26*b1cdbd2cSJim Jagielski 
27*b1cdbd2cSJim Jagielski #include <sal/types.h>
28*b1cdbd2cSJim Jagielski #include <osl/interlck.h>
29*b1cdbd2cSJim Jagielski #include <rtl/string.h>
30*b1cdbd2cSJim Jagielski #include <rtl/textenc.h>
31*b1cdbd2cSJim Jagielski 
32*b1cdbd2cSJim Jagielski #ifdef __cplusplus
33*b1cdbd2cSJim Jagielski extern "C" {
34*b1cdbd2cSJim Jagielski #endif
35*b1cdbd2cSJim Jagielski 
36*b1cdbd2cSJim Jagielski /* ======================================================================= */
37*b1cdbd2cSJim Jagielski 
38*b1cdbd2cSJim Jagielski /** Return the length of a string.
39*b1cdbd2cSJim Jagielski 
40*b1cdbd2cSJim Jagielski     The length is equal to the number of 16-bit Unicode characters in the
41*b1cdbd2cSJim Jagielski     string, without the terminating NUL character.
42*b1cdbd2cSJim Jagielski 
43*b1cdbd2cSJim Jagielski     @param str
44*b1cdbd2cSJim Jagielski     a null-terminated string.
45*b1cdbd2cSJim Jagielski 
46*b1cdbd2cSJim Jagielski     @return
47*b1cdbd2cSJim Jagielski     the length of the sequence of characters represented by this string,
48*b1cdbd2cSJim Jagielski     excluding the terminating NUL character.
49*b1cdbd2cSJim Jagielski  */
50*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_getLength( const sal_Unicode * str ) SAL_THROW_EXTERN_C();
51*b1cdbd2cSJim Jagielski 
52*b1cdbd2cSJim Jagielski /** Compare two strings.
53*b1cdbd2cSJim Jagielski 
54*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
55*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  This function
56*b1cdbd2cSJim Jagielski     cannot be used for language-specific sorting.  Both strings must be
57*b1cdbd2cSJim Jagielski     null-terminated.
58*b1cdbd2cSJim Jagielski 
59*b1cdbd2cSJim Jagielski     @param first
60*b1cdbd2cSJim Jagielski     the first null-terminated string to be compared.
61*b1cdbd2cSJim Jagielski 
62*b1cdbd2cSJim Jagielski     @param second
63*b1cdbd2cSJim Jagielski     the second null-terminated string which is compared with the first one.
64*b1cdbd2cSJim Jagielski 
65*b1cdbd2cSJim Jagielski     @return
66*b1cdbd2cSJim Jagielski     0 if both strings are equal, a value less than 0 if the first string is
67*b1cdbd2cSJim Jagielski     less than the second string, and a value greater than 0 if the first
68*b1cdbd2cSJim Jagielski     string is greater than the second string.
69*b1cdbd2cSJim Jagielski  */
70*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_compare( const sal_Unicode * first, const sal_Unicode * second ) SAL_THROW_EXTERN_C();
71*b1cdbd2cSJim Jagielski 
72*b1cdbd2cSJim Jagielski /** Compare two strings.
73*b1cdbd2cSJim Jagielski 
74*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
75*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  This function
76*b1cdbd2cSJim Jagielski     cannot be used for language-specific sorting.
77*b1cdbd2cSJim Jagielski 
78*b1cdbd2cSJim Jagielski     @param first
79*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
80*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
81*b1cdbd2cSJim Jagielski 
82*b1cdbd2cSJim Jagielski     @param firstLen
83*b1cdbd2cSJim Jagielski     the length of the first string.
84*b1cdbd2cSJim Jagielski 
85*b1cdbd2cSJim Jagielski     @param second
86*b1cdbd2cSJim Jagielski     the second string which is compared with the first one.  Need not be
87*b1cdbd2cSJim Jagielski     null-terminated, but must be at least as long as the specified secondLen.
88*b1cdbd2cSJim Jagielski 
89*b1cdbd2cSJim Jagielski     @param secondLen
90*b1cdbd2cSJim Jagielski     the length of the second string.
91*b1cdbd2cSJim Jagielski 
92*b1cdbd2cSJim Jagielski     @return
93*b1cdbd2cSJim Jagielski     0 if both strings are equal, a value less than 0 if the first string is
94*b1cdbd2cSJim Jagielski     less than the second string, and a value greater than 0 if the first
95*b1cdbd2cSJim Jagielski     string is greater than the second string.
96*b1cdbd2cSJim Jagielski  */
97*b1cdbd2cSJim Jagielski 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();
98*b1cdbd2cSJim Jagielski 
99*b1cdbd2cSJim Jagielski /** Compare two strings with a maximum count of characters.
100*b1cdbd2cSJim Jagielski 
101*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
102*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  This function
103*b1cdbd2cSJim Jagielski     cannot be used for language-specific sorting.
104*b1cdbd2cSJim Jagielski 
105*b1cdbd2cSJim Jagielski     @param first
106*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
107*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
108*b1cdbd2cSJim Jagielski 
109*b1cdbd2cSJim Jagielski     @param firstLen
110*b1cdbd2cSJim Jagielski     the length of the first string.
111*b1cdbd2cSJim Jagielski 
112*b1cdbd2cSJim Jagielski     @param second
113*b1cdbd2cSJim Jagielski     the second string which is compared with the first one.  Need not be
114*b1cdbd2cSJim Jagielski     null-terminated, but must be at least as long as the specified secondLen.
115*b1cdbd2cSJim Jagielski 
116*b1cdbd2cSJim Jagielski     @param secondLen
117*b1cdbd2cSJim Jagielski     the length of the second string.
118*b1cdbd2cSJim Jagielski 
119*b1cdbd2cSJim Jagielski     @param shortenedLen
120*b1cdbd2cSJim Jagielski     the maximum number of characters to compare.  This length can be greater
121*b1cdbd2cSJim Jagielski     or smaller than the lengths of the two strings.
122*b1cdbd2cSJim Jagielski 
123*b1cdbd2cSJim Jagielski     @return
124*b1cdbd2cSJim Jagielski     0 if both substrings are equal, a value less than 0 if the first substring
125*b1cdbd2cSJim Jagielski     is less than the second substring, and a value greater than 0 if the first
126*b1cdbd2cSJim Jagielski     substring is greater than the second substring.
127*b1cdbd2cSJim Jagielski  */
128*b1cdbd2cSJim Jagielski 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();
129*b1cdbd2cSJim Jagielski 
130*b1cdbd2cSJim Jagielski /** Compare two strings from back to front.
131*b1cdbd2cSJim Jagielski 
132*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
133*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  This function
134*b1cdbd2cSJim Jagielski     cannot be used for language-specific sorting.
135*b1cdbd2cSJim Jagielski 
136*b1cdbd2cSJim Jagielski     @param first
137*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
138*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
139*b1cdbd2cSJim Jagielski 
140*b1cdbd2cSJim Jagielski     @param firstLen
141*b1cdbd2cSJim Jagielski     the length of the first string.
142*b1cdbd2cSJim Jagielski 
143*b1cdbd2cSJim Jagielski     @param second
144*b1cdbd2cSJim Jagielski     the second string which is compared with the first one.  Need not be
145*b1cdbd2cSJim Jagielski     null-terminated, but must be at least as long as the specified secondLen.
146*b1cdbd2cSJim Jagielski 
147*b1cdbd2cSJim Jagielski     @param secondLen
148*b1cdbd2cSJim Jagielski     the length of the second string.
149*b1cdbd2cSJim Jagielski 
150*b1cdbd2cSJim Jagielski     @return
151*b1cdbd2cSJim Jagielski     0 if both strings are equal, a value less than 0 if the first string
152*b1cdbd2cSJim Jagielski     compares less than the second string, and a value greater than 0 if the
153*b1cdbd2cSJim Jagielski     first string compares greater than the second string.
154*b1cdbd2cSJim Jagielski  */
155*b1cdbd2cSJim Jagielski 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();
156*b1cdbd2cSJim Jagielski 
157*b1cdbd2cSJim Jagielski /** Compare two strings from back to front for equality.
158*b1cdbd2cSJim Jagielski 
159*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
160*b1cdbd2cSJim Jagielski     strings and returns 'true' if, ans only if, both strings are equal.
161*b1cdbd2cSJim Jagielski 	This function cannot be used for language-specific sorting.
162*b1cdbd2cSJim Jagielski 
163*b1cdbd2cSJim Jagielski     @param first
164*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
165*b1cdbd2cSJim Jagielski     at least as long as the specified len.
166*b1cdbd2cSJim Jagielski 
167*b1cdbd2cSJim Jagielski     @param second
168*b1cdbd2cSJim Jagielski     the second string which is compared with the first one.  Need not be
169*b1cdbd2cSJim Jagielski     null-terminated, but must be at least as long as the specified len.
170*b1cdbd2cSJim Jagielski 
171*b1cdbd2cSJim Jagielski     @param len
172*b1cdbd2cSJim Jagielski     the length of both strings.
173*b1cdbd2cSJim Jagielski 
174*b1cdbd2cSJim Jagielski     @return
175*b1cdbd2cSJim Jagielski     true if both strings are equal, false if they are not equal.
176*b1cdbd2cSJim Jagielski  */
177*b1cdbd2cSJim Jagielski 
178*b1cdbd2cSJim Jagielski sal_Bool SAL_CALL rtl_ustr_asciil_reverseEquals_WithLength( const sal_Unicode * first, const sal_Char * second, sal_Int32 len ) SAL_THROW_EXTERN_C();
179*b1cdbd2cSJim Jagielski 
180*b1cdbd2cSJim Jagielski /** Compare two strings, ignoring the case of ASCII characters.
181*b1cdbd2cSJim Jagielski 
182*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
183*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  Character
184*b1cdbd2cSJim Jagielski     values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
185*b1cdbd2cSJim Jagielski     and 122 (ASCII a--z).  This function cannot be used for language-specific
186*b1cdbd2cSJim Jagielski     sorting.  Both strings must be null-terminated.
187*b1cdbd2cSJim Jagielski 
188*b1cdbd2cSJim Jagielski     @param first
189*b1cdbd2cSJim Jagielski     the first null-terminated string to be compared.
190*b1cdbd2cSJim Jagielski 
191*b1cdbd2cSJim Jagielski     @param second
192*b1cdbd2cSJim Jagielski     the second null-terminated string which is compared with the first one.
193*b1cdbd2cSJim Jagielski 
194*b1cdbd2cSJim Jagielski     @return
195*b1cdbd2cSJim Jagielski     0 if both strings are equal, a value less than 0 if the first string is
196*b1cdbd2cSJim Jagielski     less than the second string, and a value greater than 0 if the first
197*b1cdbd2cSJim Jagielski     string is greater than the second string.
198*b1cdbd2cSJim Jagielski  */
199*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_compareIgnoreAsciiCase( const sal_Unicode * first, const sal_Unicode * second ) SAL_THROW_EXTERN_C();
200*b1cdbd2cSJim Jagielski 
201*b1cdbd2cSJim Jagielski /** Compare two strings, ignoring the case of ASCII characters.
202*b1cdbd2cSJim Jagielski 
203*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
204*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  Character
205*b1cdbd2cSJim Jagielski     values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
206*b1cdbd2cSJim Jagielski     and 122 (ASCII a--z).  This function cannot be used for language-specific
207*b1cdbd2cSJim Jagielski     sorting.
208*b1cdbd2cSJim Jagielski 
209*b1cdbd2cSJim Jagielski     @param first
210*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
211*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
212*b1cdbd2cSJim Jagielski 
213*b1cdbd2cSJim Jagielski     @param firstLen
214*b1cdbd2cSJim Jagielski     the length of the first string.
215*b1cdbd2cSJim Jagielski 
216*b1cdbd2cSJim Jagielski     @param second
217*b1cdbd2cSJim Jagielski     the second string which is compared with the first one.  Need not be
218*b1cdbd2cSJim Jagielski     null-terminated, but must be at least as long as the specified secondLen.
219*b1cdbd2cSJim Jagielski 
220*b1cdbd2cSJim Jagielski     @param secondLen
221*b1cdbd2cSJim Jagielski     the length of the second string.
222*b1cdbd2cSJim Jagielski 
223*b1cdbd2cSJim Jagielski     @return
224*b1cdbd2cSJim Jagielski     0 if both strings are equal, a value less than 0 if the first string is
225*b1cdbd2cSJim Jagielski     less than the second string, and a value greater than 0 if the first
226*b1cdbd2cSJim Jagielski     string is greater than the second string.
227*b1cdbd2cSJim Jagielski  */
228*b1cdbd2cSJim Jagielski 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();
229*b1cdbd2cSJim Jagielski 
230*b1cdbd2cSJim Jagielski /** Compare two strings with a maximum count of characters, ignoring the case
231*b1cdbd2cSJim Jagielski     of ASCII characters.
232*b1cdbd2cSJim Jagielski 
233*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
234*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  Character
235*b1cdbd2cSJim Jagielski     values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
236*b1cdbd2cSJim Jagielski     and 122 (ASCII a--z).  This function cannot be used for language-specific
237*b1cdbd2cSJim Jagielski     sorting.
238*b1cdbd2cSJim Jagielski 
239*b1cdbd2cSJim Jagielski     @param first
240*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
241*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
242*b1cdbd2cSJim Jagielski 
243*b1cdbd2cSJim Jagielski     @param firstLen
244*b1cdbd2cSJim Jagielski     the length of the first string.
245*b1cdbd2cSJim Jagielski 
246*b1cdbd2cSJim Jagielski     @param second
247*b1cdbd2cSJim Jagielski     the second string which is compared with the first one.  Need not be
248*b1cdbd2cSJim Jagielski     null-terminated, but must be at least as long as the specified secondLen.
249*b1cdbd2cSJim Jagielski 
250*b1cdbd2cSJim Jagielski     @param secondLen
251*b1cdbd2cSJim Jagielski     the length of the second string.
252*b1cdbd2cSJim Jagielski 
253*b1cdbd2cSJim Jagielski     @param shortenedLen
254*b1cdbd2cSJim Jagielski     the maximum number of characters to compare.  This length can be greater
255*b1cdbd2cSJim Jagielski     or smaller than the lengths of the two strings.
256*b1cdbd2cSJim Jagielski 
257*b1cdbd2cSJim Jagielski     @return
258*b1cdbd2cSJim Jagielski     0 if both substrings are equal, a value less than 0 if the first substring
259*b1cdbd2cSJim Jagielski     is less than the second substring, and a value greater than 0 if the first
260*b1cdbd2cSJim Jagielski     substring is greater than the second substring.
261*b1cdbd2cSJim Jagielski  */
262*b1cdbd2cSJim Jagielski 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();
263*b1cdbd2cSJim Jagielski 
264*b1cdbd2cSJim Jagielski /** Compare two strings.
265*b1cdbd2cSJim Jagielski 
266*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
267*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  This function
268*b1cdbd2cSJim Jagielski     cannot be used for language-specific sorting.  Both strings must be
269*b1cdbd2cSJim Jagielski     null-terminated.
270*b1cdbd2cSJim Jagielski 
271*b1cdbd2cSJim Jagielski     Since this function is optimized for performance, the ASCII character
272*b1cdbd2cSJim Jagielski     values are not converted in any way.  The caller has to make sure that
273*b1cdbd2cSJim Jagielski     all ASCII characters are in the allowed range of 0 and 127, inclusive.
274*b1cdbd2cSJim Jagielski 
275*b1cdbd2cSJim Jagielski     @param first
276*b1cdbd2cSJim Jagielski     the first null-terminated string to be compared.
277*b1cdbd2cSJim Jagielski 
278*b1cdbd2cSJim Jagielski     @param second
279*b1cdbd2cSJim Jagielski     the second null-terminated ASCII string which is compared with the first
280*b1cdbd2cSJim Jagielski     one.
281*b1cdbd2cSJim Jagielski 
282*b1cdbd2cSJim Jagielski     @return
283*b1cdbd2cSJim Jagielski     0 if both substrings are equal, a value less than 0 if the first substring
284*b1cdbd2cSJim Jagielski     is less than the second substring, and a value greater than 0 if the first
285*b1cdbd2cSJim Jagielski     substring is greater than the second substring.
286*b1cdbd2cSJim Jagielski  */
287*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_ascii_compare( const sal_Unicode * first, const sal_Char * second ) SAL_THROW_EXTERN_C();
288*b1cdbd2cSJim Jagielski 
289*b1cdbd2cSJim Jagielski /** Compare two strings.
290*b1cdbd2cSJim Jagielski 
291*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
292*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  This function
293*b1cdbd2cSJim Jagielski     cannot be used for language-specific sorting.
294*b1cdbd2cSJim Jagielski 
295*b1cdbd2cSJim Jagielski     Since this function is optimized for performance, the ASCII character
296*b1cdbd2cSJim Jagielski     values are not converted in any way.  The caller has to make sure that
297*b1cdbd2cSJim Jagielski     all ASCII characters are in the allowed range of 0 and 127, inclusive.
298*b1cdbd2cSJim Jagielski 
299*b1cdbd2cSJim Jagielski     @param first
300*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
301*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
302*b1cdbd2cSJim Jagielski 
303*b1cdbd2cSJim Jagielski     @param firstLen
304*b1cdbd2cSJim Jagielski     the length of the first string.
305*b1cdbd2cSJim Jagielski 
306*b1cdbd2cSJim Jagielski     @param second
307*b1cdbd2cSJim Jagielski     the second null-terminated ASCII string which is compared with the first
308*b1cdbd2cSJim Jagielski     one.
309*b1cdbd2cSJim Jagielski 
310*b1cdbd2cSJim Jagielski     @return
311*b1cdbd2cSJim Jagielski     0 if both substrings are equal, a value less than 0 if the first substring
312*b1cdbd2cSJim Jagielski     is less than the second substring, and a value greater than 0 if the first
313*b1cdbd2cSJim Jagielski     substring is greater than the second substring.
314*b1cdbd2cSJim Jagielski  */
315*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_ascii_compare_WithLength( const sal_Unicode * first, sal_Int32 firstLen, const sal_Char * second ) SAL_THROW_EXTERN_C();
316*b1cdbd2cSJim Jagielski 
317*b1cdbd2cSJim Jagielski /** Compare two strings with a maximum count of characters.
318*b1cdbd2cSJim Jagielski 
319*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
320*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  This function
321*b1cdbd2cSJim Jagielski     cannot be used for language-specific sorting.
322*b1cdbd2cSJim Jagielski 
323*b1cdbd2cSJim Jagielski     Since this function is optimized for performance, the ASCII character
324*b1cdbd2cSJim Jagielski     values are not converted in any way.  The caller has to make sure that
325*b1cdbd2cSJim Jagielski     all ASCII characters are in the allowed range of 0 and 127, inclusive.
326*b1cdbd2cSJim Jagielski 
327*b1cdbd2cSJim Jagielski     @param first
328*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
329*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
330*b1cdbd2cSJim Jagielski 
331*b1cdbd2cSJim Jagielski     @param firstLen
332*b1cdbd2cSJim Jagielski     the length of the first string.
333*b1cdbd2cSJim Jagielski 
334*b1cdbd2cSJim Jagielski     @param second
335*b1cdbd2cSJim Jagielski     the second null-terminated ASCII string which is compared with the first
336*b1cdbd2cSJim Jagielski     one.
337*b1cdbd2cSJim Jagielski 
338*b1cdbd2cSJim Jagielski     @param shortenedLen
339*b1cdbd2cSJim Jagielski     the maximum number of characters to compare.  This length can be greater
340*b1cdbd2cSJim Jagielski     or smaller than the lengths of the two strings.
341*b1cdbd2cSJim Jagielski 
342*b1cdbd2cSJim Jagielski     @return
343*b1cdbd2cSJim Jagielski     0 if both substrings are equal, a value less than 0 if the first substring
344*b1cdbd2cSJim Jagielski     is less than the second substring, and a value greater than 0 if the first
345*b1cdbd2cSJim Jagielski     substring is greater than the second substring.
346*b1cdbd2cSJim Jagielski  */
347*b1cdbd2cSJim Jagielski 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();
348*b1cdbd2cSJim Jagielski 
349*b1cdbd2cSJim Jagielski /** Compare two strings from back to front.
350*b1cdbd2cSJim Jagielski 
351*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
352*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  This function
353*b1cdbd2cSJim Jagielski     cannot be used for language-specific sorting.
354*b1cdbd2cSJim Jagielski 
355*b1cdbd2cSJim Jagielski     Since this function is optimized for performance, the ASCII character
356*b1cdbd2cSJim Jagielski     values are not converted in any way.  The caller has to make sure that
357*b1cdbd2cSJim Jagielski     all ASCII characters are in the allowed range of 0 and 127, inclusive.
358*b1cdbd2cSJim Jagielski 
359*b1cdbd2cSJim Jagielski     @param first
360*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
361*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
362*b1cdbd2cSJim Jagielski 
363*b1cdbd2cSJim Jagielski     @param firstLen
364*b1cdbd2cSJim Jagielski     the length of the first string.
365*b1cdbd2cSJim Jagielski 
366*b1cdbd2cSJim Jagielski     @param second
367*b1cdbd2cSJim Jagielski     the second ASCII string which is compared with the first one.  Need not be
368*b1cdbd2cSJim Jagielski     null-terminated, but must be at least as long as the specified secondLen.
369*b1cdbd2cSJim Jagielski 
370*b1cdbd2cSJim Jagielski     @param secondLen
371*b1cdbd2cSJim Jagielski     the length of the second string.
372*b1cdbd2cSJim Jagielski 
373*b1cdbd2cSJim Jagielski     @return
374*b1cdbd2cSJim Jagielski     0 if both strings are equal, a value less than 0 if the first string
375*b1cdbd2cSJim Jagielski     compares less than the second string, and a value greater than 0 if the
376*b1cdbd2cSJim Jagielski     first string compares greater than the second string.
377*b1cdbd2cSJim Jagielski  */
378*b1cdbd2cSJim Jagielski 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();
379*b1cdbd2cSJim Jagielski 
380*b1cdbd2cSJim Jagielski /** Compare two strings, ignoring the case of ASCII characters.
381*b1cdbd2cSJim Jagielski 
382*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
383*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  Character
384*b1cdbd2cSJim Jagielski     values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
385*b1cdbd2cSJim Jagielski     and 122 (ASCII a--z).  This function cannot be used for language-specific
386*b1cdbd2cSJim Jagielski     sorting.  Both strings must be null-terminated.
387*b1cdbd2cSJim Jagielski 
388*b1cdbd2cSJim Jagielski     Since this function is optimized for performance, the ASCII character
389*b1cdbd2cSJim Jagielski     values are not converted in any way.  The caller has to make sure that
390*b1cdbd2cSJim Jagielski     all ASCII characters are in the allowed range of 0 and 127, inclusive.
391*b1cdbd2cSJim Jagielski 
392*b1cdbd2cSJim Jagielski     @param first
393*b1cdbd2cSJim Jagielski     the first null-terminated string to be compared.
394*b1cdbd2cSJim Jagielski 
395*b1cdbd2cSJim Jagielski     @param second
396*b1cdbd2cSJim Jagielski     the second null-terminated ASCII string which is compared with the first
397*b1cdbd2cSJim Jagielski     one.
398*b1cdbd2cSJim Jagielski 
399*b1cdbd2cSJim Jagielski     @return
400*b1cdbd2cSJim Jagielski     0 if both strings are equal, a value less than 0 if the first string is
401*b1cdbd2cSJim Jagielski     less than the second string, and a value greater than 0 if the first
402*b1cdbd2cSJim Jagielski     string is greater than the second string.
403*b1cdbd2cSJim Jagielski  */
404*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase( const sal_Unicode * first, const sal_Char * second ) SAL_THROW_EXTERN_C();
405*b1cdbd2cSJim Jagielski 
406*b1cdbd2cSJim Jagielski /** Compare two strings, ignoring the case of ASCII characters.
407*b1cdbd2cSJim Jagielski 
408*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
409*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  Character
410*b1cdbd2cSJim Jagielski     values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
411*b1cdbd2cSJim Jagielski     and 122 (ASCII a--z).  This function cannot be used for language-specific
412*b1cdbd2cSJim Jagielski     sorting.
413*b1cdbd2cSJim Jagielski 
414*b1cdbd2cSJim Jagielski     Since this function is optimized for performance, the ASCII character
415*b1cdbd2cSJim Jagielski     values are not converted in any way.  The caller has to make sure that
416*b1cdbd2cSJim Jagielski     all ASCII characters are in the allowed range of 0 and 127, inclusive.
417*b1cdbd2cSJim Jagielski 
418*b1cdbd2cSJim Jagielski     @param first
419*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
420*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
421*b1cdbd2cSJim Jagielski 
422*b1cdbd2cSJim Jagielski     @param firstLen
423*b1cdbd2cSJim Jagielski     the length of the first string.
424*b1cdbd2cSJim Jagielski 
425*b1cdbd2cSJim Jagielski     @param second
426*b1cdbd2cSJim Jagielski     the second null-terminated ASCII string which is compared with the first
427*b1cdbd2cSJim Jagielski     one.
428*b1cdbd2cSJim Jagielski 
429*b1cdbd2cSJim Jagielski     @return
430*b1cdbd2cSJim Jagielski     0 if both strings are equal, a value less than 0 if the first string is
431*b1cdbd2cSJim Jagielski     less than the second string, and a value greater than 0 if the first
432*b1cdbd2cSJim Jagielski     string is greater than the second string.
433*b1cdbd2cSJim Jagielski  */
434*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( const sal_Unicode * first, sal_Int32 firstLen, const sal_Char * second ) SAL_THROW_EXTERN_C();
435*b1cdbd2cSJim Jagielski 
436*b1cdbd2cSJim Jagielski /** Compare two strings, ignoring the case of ASCII characters.
437*b1cdbd2cSJim Jagielski 
438*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
439*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  Character
440*b1cdbd2cSJim Jagielski     values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
441*b1cdbd2cSJim Jagielski     and 122 (ASCII a--z).  This function cannot be used for language-specific
442*b1cdbd2cSJim Jagielski     sorting.
443*b1cdbd2cSJim Jagielski 
444*b1cdbd2cSJim Jagielski     Since this function is optimized for performance, the ASCII character
445*b1cdbd2cSJim Jagielski     values are not converted in any way.  The caller has to make sure that
446*b1cdbd2cSJim Jagielski     all ASCII characters are in the allowed range of 0 and 127, inclusive.
447*b1cdbd2cSJim Jagielski 
448*b1cdbd2cSJim Jagielski     @param first
449*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
450*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
451*b1cdbd2cSJim Jagielski 
452*b1cdbd2cSJim Jagielski     @param firstLen
453*b1cdbd2cSJim Jagielski     the length of the first string.
454*b1cdbd2cSJim Jagielski 
455*b1cdbd2cSJim Jagielski     @param second
456*b1cdbd2cSJim Jagielski     the second string which is compared with the first one.  Need not be
457*b1cdbd2cSJim Jagielski     null-terminated, but must be at least as long as the specified secondLen.
458*b1cdbd2cSJim Jagielski 
459*b1cdbd2cSJim Jagielski     @param secondLen
460*b1cdbd2cSJim Jagielski     the length of the second string.
461*b1cdbd2cSJim Jagielski 
462*b1cdbd2cSJim Jagielski     @return
463*b1cdbd2cSJim Jagielski     0 if both strings are equal, a value less than 0 if the first string is
464*b1cdbd2cSJim Jagielski     less than the second string, and a value greater than 0 if the first
465*b1cdbd2cSJim Jagielski     string is greater than the second string.
466*b1cdbd2cSJim Jagielski  */
467*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
468*b1cdbd2cSJim Jagielski     sal_Unicode const * first, sal_Int32 firstLen,
469*b1cdbd2cSJim Jagielski     char const * second, sal_Int32 secondLen) SAL_THROW_EXTERN_C();
470*b1cdbd2cSJim Jagielski 
471*b1cdbd2cSJim Jagielski /** Compare two strings with a maximum count of characters, ignoring the case
472*b1cdbd2cSJim Jagielski     of ASCII characters.
473*b1cdbd2cSJim Jagielski 
474*b1cdbd2cSJim Jagielski     The comparison is based on the numeric value of each character in the
475*b1cdbd2cSJim Jagielski     strings and returns a value indicating their relationship.  Character
476*b1cdbd2cSJim Jagielski     values between 65 and 90 (ASCII A--Z) are interpreted as values between 97
477*b1cdbd2cSJim Jagielski     and 122 (ASCII a--z).  This function cannot be used for language-specific
478*b1cdbd2cSJim Jagielski     sorting.
479*b1cdbd2cSJim Jagielski 
480*b1cdbd2cSJim Jagielski     Since this function is optimized for performance, the ASCII character
481*b1cdbd2cSJim Jagielski     values are not converted in any way.  The caller has to make sure that
482*b1cdbd2cSJim Jagielski     all ASCII characters are in the allowed range of 0 and 127, inclusive.
483*b1cdbd2cSJim Jagielski 
484*b1cdbd2cSJim Jagielski     @param first
485*b1cdbd2cSJim Jagielski     the first string to be compared.  Need not be null-terminated, but must be
486*b1cdbd2cSJim Jagielski     at least as long as the specified firstLen.
487*b1cdbd2cSJim Jagielski 
488*b1cdbd2cSJim Jagielski     @param firstLen
489*b1cdbd2cSJim Jagielski     the length of the first string.
490*b1cdbd2cSJim Jagielski 
491*b1cdbd2cSJim Jagielski     @param second
492*b1cdbd2cSJim Jagielski     the second null-terminated ASCII string which is compared with the first
493*b1cdbd2cSJim Jagielski     one.
494*b1cdbd2cSJim Jagielski 
495*b1cdbd2cSJim Jagielski     @param shortenedLen
496*b1cdbd2cSJim Jagielski     the maximum number of characters to compare.  This length can be greater
497*b1cdbd2cSJim Jagielski     or smaller than the lengths of the two strings.
498*b1cdbd2cSJim Jagielski 
499*b1cdbd2cSJim Jagielski     @return
500*b1cdbd2cSJim Jagielski     0 if both substrings are equal, a value less than 0 if the first substring
501*b1cdbd2cSJim Jagielski     is less than the second substring, and a value greater than 0 if the first
502*b1cdbd2cSJim Jagielski     substring is greater than the second substring.
503*b1cdbd2cSJim Jagielski  */
504*b1cdbd2cSJim Jagielski 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();
505*b1cdbd2cSJim Jagielski 
506*b1cdbd2cSJim Jagielski /** Return a hash code for a string.
507*b1cdbd2cSJim Jagielski 
508*b1cdbd2cSJim Jagielski     It is not allowed to store the hash code persistently, because later
509*b1cdbd2cSJim Jagielski     versions could return other hash codes.  The string must be
510*b1cdbd2cSJim Jagielski     null-terminated.
511*b1cdbd2cSJim Jagielski 
512*b1cdbd2cSJim Jagielski     @param str
513*b1cdbd2cSJim Jagielski     a null-terminated string.
514*b1cdbd2cSJim Jagielski 
515*b1cdbd2cSJim Jagielski     @return
516*b1cdbd2cSJim Jagielski     a hash code for the given string.
517*b1cdbd2cSJim Jagielski  */
518*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_hashCode( const sal_Unicode * str ) SAL_THROW_EXTERN_C();
519*b1cdbd2cSJim Jagielski 
520*b1cdbd2cSJim Jagielski /** Return a hash code for a string.
521*b1cdbd2cSJim Jagielski 
522*b1cdbd2cSJim Jagielski     It is not allowed to store the hash code persistently, because later
523*b1cdbd2cSJim Jagielski     versions could return other hash codes.
524*b1cdbd2cSJim Jagielski 
525*b1cdbd2cSJim Jagielski     @param str
526*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
527*b1cdbd2cSJim Jagielski     the specified len.
528*b1cdbd2cSJim Jagielski 
529*b1cdbd2cSJim Jagielski     @param len
530*b1cdbd2cSJim Jagielski     the length of the string.
531*b1cdbd2cSJim Jagielski 
532*b1cdbd2cSJim Jagielski     @return
533*b1cdbd2cSJim Jagielski     a hash code for the given string.
534*b1cdbd2cSJim Jagielski  */
535*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_hashCode_WithLength( const sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
536*b1cdbd2cSJim Jagielski 
537*b1cdbd2cSJim Jagielski /** Search for the first occurrence of a character within a string.
538*b1cdbd2cSJim Jagielski 
539*b1cdbd2cSJim Jagielski     The string must be null-terminated.
540*b1cdbd2cSJim Jagielski 
541*b1cdbd2cSJim Jagielski     @param str
542*b1cdbd2cSJim Jagielski     a null-terminated string.
543*b1cdbd2cSJim Jagielski 
544*b1cdbd2cSJim Jagielski     @param ch
545*b1cdbd2cSJim Jagielski     the character to be searched for.
546*b1cdbd2cSJim Jagielski 
547*b1cdbd2cSJim Jagielski     @return
548*b1cdbd2cSJim Jagielski     the index (starting at 0) of the first occurrence of the character in the
549*b1cdbd2cSJim Jagielski     string, or -1 if the character does not occur.
550*b1cdbd2cSJim Jagielski  */
551*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_indexOfChar( const sal_Unicode * str, sal_Unicode ch ) SAL_THROW_EXTERN_C();
552*b1cdbd2cSJim Jagielski 
553*b1cdbd2cSJim Jagielski /** Search for the first occurrence of a character within a string.
554*b1cdbd2cSJim Jagielski 
555*b1cdbd2cSJim Jagielski     @param str
556*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
557*b1cdbd2cSJim Jagielski     the specified len.
558*b1cdbd2cSJim Jagielski 
559*b1cdbd2cSJim Jagielski     @param len
560*b1cdbd2cSJim Jagielski     the length of the string.
561*b1cdbd2cSJim Jagielski 
562*b1cdbd2cSJim Jagielski     @param ch
563*b1cdbd2cSJim Jagielski     the character to be searched for.
564*b1cdbd2cSJim Jagielski 
565*b1cdbd2cSJim Jagielski     @return
566*b1cdbd2cSJim Jagielski     the index (starting at 0) of the first occurrence of the character in the
567*b1cdbd2cSJim Jagielski     string, or -1 if the character does not occur.
568*b1cdbd2cSJim Jagielski  */
569*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_indexOfChar_WithLength( const sal_Unicode * str, sal_Int32 len, sal_Unicode ch ) SAL_THROW_EXTERN_C();
570*b1cdbd2cSJim Jagielski 
571*b1cdbd2cSJim Jagielski /** Search for the last occurrence of a character within a string.
572*b1cdbd2cSJim Jagielski 
573*b1cdbd2cSJim Jagielski     The string must be null-terminated.
574*b1cdbd2cSJim Jagielski 
575*b1cdbd2cSJim Jagielski     @param str
576*b1cdbd2cSJim Jagielski     a null-terminated string.
577*b1cdbd2cSJim Jagielski 
578*b1cdbd2cSJim Jagielski     @param ch
579*b1cdbd2cSJim Jagielski     the character to be searched for.
580*b1cdbd2cSJim Jagielski 
581*b1cdbd2cSJim Jagielski     @return
582*b1cdbd2cSJim Jagielski     the index (starting at 0) of the last occurrence of the character in the
583*b1cdbd2cSJim Jagielski     string, or -1 if the character does not occur.  The returned value is
584*b1cdbd2cSJim Jagielski     always smaller than the string length.
585*b1cdbd2cSJim Jagielski  */
586*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_lastIndexOfChar( const sal_Unicode * str, sal_Unicode ch ) SAL_THROW_EXTERN_C();
587*b1cdbd2cSJim Jagielski 
588*b1cdbd2cSJim Jagielski /** Search for the last occurrence of a character within a string.
589*b1cdbd2cSJim Jagielski 
590*b1cdbd2cSJim Jagielski     @param str
591*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
592*b1cdbd2cSJim Jagielski     the specified len.
593*b1cdbd2cSJim Jagielski 
594*b1cdbd2cSJim Jagielski     @param len
595*b1cdbd2cSJim Jagielski     the length of the string.
596*b1cdbd2cSJim Jagielski 
597*b1cdbd2cSJim Jagielski     @param ch
598*b1cdbd2cSJim Jagielski     the character to be searched for.
599*b1cdbd2cSJim Jagielski 
600*b1cdbd2cSJim Jagielski     @return
601*b1cdbd2cSJim Jagielski     the index (starting at 0) of the last occurrence of the character in the
602*b1cdbd2cSJim Jagielski     string, or -1 if the character does not occur.  The returned value is
603*b1cdbd2cSJim Jagielski     always smaller than the string length.
604*b1cdbd2cSJim Jagielski  */
605*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_lastIndexOfChar_WithLength( const sal_Unicode * str, sal_Int32 len, sal_Unicode ch ) SAL_THROW_EXTERN_C();
606*b1cdbd2cSJim Jagielski 
607*b1cdbd2cSJim Jagielski /** Search for the first occurrence of a substring within a string.
608*b1cdbd2cSJim Jagielski 
609*b1cdbd2cSJim Jagielski     If subStr is empty, or both str and subStr are empty, -1 is returned.
610*b1cdbd2cSJim Jagielski     Both strings must be null-terminated.
611*b1cdbd2cSJim Jagielski 
612*b1cdbd2cSJim Jagielski     @param str
613*b1cdbd2cSJim Jagielski     a null-terminated string.
614*b1cdbd2cSJim Jagielski 
615*b1cdbd2cSJim Jagielski     @param subStr
616*b1cdbd2cSJim Jagielski     the null-terminated substring to be searched for.
617*b1cdbd2cSJim Jagielski 
618*b1cdbd2cSJim Jagielski     @return
619*b1cdbd2cSJim Jagielski     the index (starting at 0) of the first character of the first occurrence
620*b1cdbd2cSJim Jagielski     of the substring within the string, or -1 if the substring does not occur.
621*b1cdbd2cSJim Jagielski  */
622*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_indexOfStr( const sal_Unicode * str, const sal_Unicode * subStr ) SAL_THROW_EXTERN_C();
623*b1cdbd2cSJim Jagielski 
624*b1cdbd2cSJim Jagielski /** Search for the first occurrence of a substring within a string.
625*b1cdbd2cSJim Jagielski 
626*b1cdbd2cSJim Jagielski     If subStr is empty, or both str and subStr are empty, -1 is returned.
627*b1cdbd2cSJim Jagielski 
628*b1cdbd2cSJim Jagielski     @param str
629*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
630*b1cdbd2cSJim Jagielski     the specified len.
631*b1cdbd2cSJim Jagielski 
632*b1cdbd2cSJim Jagielski     @param len
633*b1cdbd2cSJim Jagielski     the length of the string.
634*b1cdbd2cSJim Jagielski 
635*b1cdbd2cSJim Jagielski     @param subStr
636*b1cdbd2cSJim Jagielski     the substring to be searched for.  Need not be null-terminated, but must
637*b1cdbd2cSJim Jagielski     be at least as long as the specified subLen.
638*b1cdbd2cSJim Jagielski 
639*b1cdbd2cSJim Jagielski     @param subLen
640*b1cdbd2cSJim Jagielski     the length of the substring.
641*b1cdbd2cSJim Jagielski 
642*b1cdbd2cSJim Jagielski     @return
643*b1cdbd2cSJim Jagielski     the index (starting at 0) of the first character of the first occurrence
644*b1cdbd2cSJim Jagielski     of the substring within the string, or -1 if the substring does not occur.
645*b1cdbd2cSJim Jagielski  */
646*b1cdbd2cSJim Jagielski 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();
647*b1cdbd2cSJim Jagielski 
648*b1cdbd2cSJim Jagielski /** Search for the first occurrence of an ASCII substring within a string.
649*b1cdbd2cSJim Jagielski 
650*b1cdbd2cSJim Jagielski     @param str
651*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
652*b1cdbd2cSJim Jagielski     the specified len.
653*b1cdbd2cSJim Jagielski 
654*b1cdbd2cSJim Jagielski     @param len
655*b1cdbd2cSJim Jagielski     the length of the string; must be non-negative.
656*b1cdbd2cSJim Jagielski 
657*b1cdbd2cSJim Jagielski     @param subStr
658*b1cdbd2cSJim Jagielski     the substring to be searched for.  Need not be null-terminated, but must
659*b1cdbd2cSJim Jagielski     be at least as long as the specified subLen.  Must only contain characters
660*b1cdbd2cSJim Jagielski     in the ASCII range 0x00--7F.
661*b1cdbd2cSJim Jagielski 
662*b1cdbd2cSJim Jagielski     @param subLen
663*b1cdbd2cSJim Jagielski     the length of the substring; must be non-negative.
664*b1cdbd2cSJim Jagielski 
665*b1cdbd2cSJim Jagielski     @return
666*b1cdbd2cSJim Jagielski     the index (starting at 0) of the first character of the first occurrence
667*b1cdbd2cSJim Jagielski     of the substring within the string, or -1 if the substring does not occur.
668*b1cdbd2cSJim Jagielski     If subLen is zero, -1 is returned.
669*b1cdbd2cSJim Jagielski 
670*b1cdbd2cSJim Jagielski     @since UDK 3.2.7
671*b1cdbd2cSJim Jagielski */
672*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_indexOfAscii_WithLength(
673*b1cdbd2cSJim Jagielski     sal_Unicode const * str, sal_Int32 len,
674*b1cdbd2cSJim Jagielski     char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C();
675*b1cdbd2cSJim Jagielski 
676*b1cdbd2cSJim Jagielski /** Search for the last occurrence of a substring within a string.
677*b1cdbd2cSJim Jagielski 
678*b1cdbd2cSJim Jagielski     If subStr is empty, or both str and subStr are empty, -1 is returned.
679*b1cdbd2cSJim Jagielski     Both strings must be null-terminated.
680*b1cdbd2cSJim Jagielski 
681*b1cdbd2cSJim Jagielski     @param str
682*b1cdbd2cSJim Jagielski     a null-terminated string.
683*b1cdbd2cSJim Jagielski 
684*b1cdbd2cSJim Jagielski     @param subStr
685*b1cdbd2cSJim Jagielski     the null-terminated substring to be searched for.
686*b1cdbd2cSJim Jagielski 
687*b1cdbd2cSJim Jagielski     @return
688*b1cdbd2cSJim Jagielski     the index (starting at 0) of the first character of the last occurrence
689*b1cdbd2cSJim Jagielski     of the substring within the string, or -1 if the substring does not occur.
690*b1cdbd2cSJim Jagielski  */
691*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_lastIndexOfStr( const sal_Unicode * str, const sal_Unicode * subStr ) SAL_THROW_EXTERN_C();
692*b1cdbd2cSJim Jagielski 
693*b1cdbd2cSJim Jagielski /** Search for the last occurrence of a substring within a string.
694*b1cdbd2cSJim Jagielski 
695*b1cdbd2cSJim Jagielski     If subStr is empty, or both str and subStr are empty, -1 is returned.
696*b1cdbd2cSJim Jagielski 
697*b1cdbd2cSJim Jagielski     @param str
698*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
699*b1cdbd2cSJim Jagielski     the specified len.
700*b1cdbd2cSJim Jagielski 
701*b1cdbd2cSJim Jagielski     @param len
702*b1cdbd2cSJim Jagielski     the length of the string.
703*b1cdbd2cSJim Jagielski 
704*b1cdbd2cSJim Jagielski     @param subStr
705*b1cdbd2cSJim Jagielski     the substring to be searched for.  Need not be null-terminated, but must
706*b1cdbd2cSJim Jagielski     be at least as long as the specified subLen.
707*b1cdbd2cSJim Jagielski 
708*b1cdbd2cSJim Jagielski     @param subLen
709*b1cdbd2cSJim Jagielski     the length of the substring.
710*b1cdbd2cSJim Jagielski 
711*b1cdbd2cSJim Jagielski     @return
712*b1cdbd2cSJim Jagielski     the index (starting at 0) of the first character of the first occurrence
713*b1cdbd2cSJim Jagielski     of the substring within the string, or -1 if the substring does not occur.
714*b1cdbd2cSJim Jagielski  */
715*b1cdbd2cSJim Jagielski 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();
716*b1cdbd2cSJim Jagielski 
717*b1cdbd2cSJim Jagielski /** Search for the last occurrence of an ASCII substring within a string.
718*b1cdbd2cSJim Jagielski 
719*b1cdbd2cSJim Jagielski     @param str
720*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
721*b1cdbd2cSJim Jagielski     the specified len.
722*b1cdbd2cSJim Jagielski 
723*b1cdbd2cSJim Jagielski     @param len
724*b1cdbd2cSJim Jagielski     the length of the string; must be non-negative.
725*b1cdbd2cSJim Jagielski 
726*b1cdbd2cSJim Jagielski     @param subStr
727*b1cdbd2cSJim Jagielski     the substring to be searched for.  Need not be null-terminated, but must
728*b1cdbd2cSJim Jagielski     be at least as long as the specified subLen.  Must only contain characters
729*b1cdbd2cSJim Jagielski     in the ASCII range 0x00--7F.
730*b1cdbd2cSJim Jagielski 
731*b1cdbd2cSJim Jagielski     @param subLen
732*b1cdbd2cSJim Jagielski     the length of the substring; must be non-negative.
733*b1cdbd2cSJim Jagielski 
734*b1cdbd2cSJim Jagielski     @return
735*b1cdbd2cSJim Jagielski     the index (starting at 0) of the first character of the last occurrence
736*b1cdbd2cSJim Jagielski     of the substring within the string, or -1 if the substring does not occur.
737*b1cdbd2cSJim Jagielski     If subLen is zero, -1 is returned.
738*b1cdbd2cSJim Jagielski 
739*b1cdbd2cSJim Jagielski     @since UDK 3.2.7
740*b1cdbd2cSJim Jagielski */
741*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_lastIndexOfAscii_WithLength(
742*b1cdbd2cSJim Jagielski     sal_Unicode const * str, sal_Int32 len,
743*b1cdbd2cSJim Jagielski     char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C();
744*b1cdbd2cSJim Jagielski 
745*b1cdbd2cSJim Jagielski /** Replace all occurrences of a single character within a string.
746*b1cdbd2cSJim Jagielski 
747*b1cdbd2cSJim Jagielski     If oldChar does not occur within str, then the string is not modified.
748*b1cdbd2cSJim Jagielski     The string must be null-terminated.
749*b1cdbd2cSJim Jagielski 
750*b1cdbd2cSJim Jagielski     @param str
751*b1cdbd2cSJim Jagielski     a null-terminated string.
752*b1cdbd2cSJim Jagielski 
753*b1cdbd2cSJim Jagielski     @param oldChar
754*b1cdbd2cSJim Jagielski     the old character.
755*b1cdbd2cSJim Jagielski 
756*b1cdbd2cSJim Jagielski     @param newChar
757*b1cdbd2cSJim Jagielski     the new character.
758*b1cdbd2cSJim Jagielski  */
759*b1cdbd2cSJim Jagielski void SAL_CALL rtl_ustr_replaceChar( sal_Unicode * str, sal_Unicode oldChar, sal_Unicode newChar ) SAL_THROW_EXTERN_C();
760*b1cdbd2cSJim Jagielski 
761*b1cdbd2cSJim Jagielski /** Replace all occurrences of a single character within a string.
762*b1cdbd2cSJim Jagielski 
763*b1cdbd2cSJim Jagielski     If oldChar does not occur within str, then the string is not modified.
764*b1cdbd2cSJim Jagielski 
765*b1cdbd2cSJim Jagielski     @param str
766*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
767*b1cdbd2cSJim Jagielski     the specified len.
768*b1cdbd2cSJim Jagielski 
769*b1cdbd2cSJim Jagielski     @param len
770*b1cdbd2cSJim Jagielski     the length of the string.
771*b1cdbd2cSJim Jagielski 
772*b1cdbd2cSJim Jagielski     @param oldChar
773*b1cdbd2cSJim Jagielski     the old character.
774*b1cdbd2cSJim Jagielski 
775*b1cdbd2cSJim Jagielski     @param newChar
776*b1cdbd2cSJim Jagielski     the new character.
777*b1cdbd2cSJim Jagielski  */
778*b1cdbd2cSJim Jagielski void SAL_CALL rtl_ustr_replaceChar_WithLength( sal_Unicode * str, sal_Int32 len, sal_Unicode oldChar, sal_Unicode newChar ) SAL_THROW_EXTERN_C();
779*b1cdbd2cSJim Jagielski 
780*b1cdbd2cSJim Jagielski /** Convert all ASCII uppercase letters to lowercase within a string.
781*b1cdbd2cSJim Jagielski 
782*b1cdbd2cSJim Jagielski     The characters with values between 65 and 90 (ASCII A--Z) are replaced
783*b1cdbd2cSJim Jagielski     with values between 97 and 122 (ASCII a--z).  The string must be
784*b1cdbd2cSJim Jagielski     null-terminated.
785*b1cdbd2cSJim Jagielski 
786*b1cdbd2cSJim Jagielski     @param str
787*b1cdbd2cSJim Jagielski     a null-terminated string.
788*b1cdbd2cSJim Jagielski  */
789*b1cdbd2cSJim Jagielski void SAL_CALL rtl_ustr_toAsciiLowerCase( sal_Unicode * str ) SAL_THROW_EXTERN_C();
790*b1cdbd2cSJim Jagielski 
791*b1cdbd2cSJim Jagielski /** Convert all ASCII uppercase letters to lowercase within a string.
792*b1cdbd2cSJim Jagielski 
793*b1cdbd2cSJim Jagielski     The characters with values between 65 and 90 (ASCII A--Z) are replaced
794*b1cdbd2cSJim Jagielski     with values between 97 and 122 (ASCII a--z).
795*b1cdbd2cSJim Jagielski 
796*b1cdbd2cSJim Jagielski     @param str
797*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
798*b1cdbd2cSJim Jagielski     the specified len.
799*b1cdbd2cSJim Jagielski 
800*b1cdbd2cSJim Jagielski     @param len
801*b1cdbd2cSJim Jagielski     the length of the string.
802*b1cdbd2cSJim Jagielski  */
803*b1cdbd2cSJim Jagielski void SAL_CALL rtl_ustr_toAsciiLowerCase_WithLength( sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
804*b1cdbd2cSJim Jagielski 
805*b1cdbd2cSJim Jagielski /** Convert all ASCII lowercase letters to uppercase within a string.
806*b1cdbd2cSJim Jagielski 
807*b1cdbd2cSJim Jagielski     The characters with values between 97 and 122 (ASCII a--z) are replaced
808*b1cdbd2cSJim Jagielski     with values between 65 and 90 (ASCII A--Z).  The string must be
809*b1cdbd2cSJim Jagielski     null-terminated.
810*b1cdbd2cSJim Jagielski 
811*b1cdbd2cSJim Jagielski     @param str
812*b1cdbd2cSJim Jagielski     a null-terminated string.
813*b1cdbd2cSJim Jagielski  */
814*b1cdbd2cSJim Jagielski void SAL_CALL rtl_ustr_toAsciiUpperCase( sal_Unicode * str ) SAL_THROW_EXTERN_C();
815*b1cdbd2cSJim Jagielski 
816*b1cdbd2cSJim Jagielski /** Convert all ASCII lowercase letters to uppercase within a string.
817*b1cdbd2cSJim Jagielski 
818*b1cdbd2cSJim Jagielski     The characters with values between 97 and 122 (ASCII a--z) are replaced
819*b1cdbd2cSJim Jagielski     with values between 65 and 90 (ASCII A--Z).
820*b1cdbd2cSJim Jagielski 
821*b1cdbd2cSJim Jagielski     @param str
822*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
823*b1cdbd2cSJim Jagielski     the specified len.
824*b1cdbd2cSJim Jagielski 
825*b1cdbd2cSJim Jagielski     @param len
826*b1cdbd2cSJim Jagielski     the length of the string.
827*b1cdbd2cSJim Jagielski  */
828*b1cdbd2cSJim Jagielski void SAL_CALL rtl_ustr_toAsciiUpperCase_WithLength( sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
829*b1cdbd2cSJim Jagielski 
830*b1cdbd2cSJim Jagielski /** Remove white space from both ends of a string.
831*b1cdbd2cSJim Jagielski 
832*b1cdbd2cSJim Jagielski     All characters with values less than or equal to 32 (the space character)
833*b1cdbd2cSJim Jagielski     are considered to be white space.  This function cannot be used for
834*b1cdbd2cSJim Jagielski     language-specific operations.  The string must be null-terminated.
835*b1cdbd2cSJim Jagielski 
836*b1cdbd2cSJim Jagielski     @param str
837*b1cdbd2cSJim Jagielski     a null-terminated string.
838*b1cdbd2cSJim Jagielski 
839*b1cdbd2cSJim Jagielski     @return
840*b1cdbd2cSJim Jagielski     the new length of the string.
841*b1cdbd2cSJim Jagielski  */
842*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_trim( sal_Unicode * str ) SAL_THROW_EXTERN_C();
843*b1cdbd2cSJim Jagielski 
844*b1cdbd2cSJim Jagielski /** Remove white space from both ends of the string.
845*b1cdbd2cSJim Jagielski 
846*b1cdbd2cSJim Jagielski     All characters with values less than or equal to 32 (the space character)
847*b1cdbd2cSJim Jagielski     are considered to be white space.  This function cannot be used for
848*b1cdbd2cSJim Jagielski     language-specific operations.  The string must be null-terminated.
849*b1cdbd2cSJim Jagielski 
850*b1cdbd2cSJim Jagielski     @param str
851*b1cdbd2cSJim Jagielski     a string.  Need not be null-terminated, but must be at least as long as
852*b1cdbd2cSJim Jagielski     the specified len.
853*b1cdbd2cSJim Jagielski 
854*b1cdbd2cSJim Jagielski     @param len
855*b1cdbd2cSJim Jagielski     the original length of the string.
856*b1cdbd2cSJim Jagielski 
857*b1cdbd2cSJim Jagielski     @return
858*b1cdbd2cSJim Jagielski     the new length of the string.
859*b1cdbd2cSJim Jagielski  */
860*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_trim_WithLength( sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
861*b1cdbd2cSJim Jagielski 
862*b1cdbd2cSJim Jagielski /** Create the string representation of a boolean.
863*b1cdbd2cSJim Jagielski 
864*b1cdbd2cSJim Jagielski     If b is true, the buffer is filled with the string "true" and 5 is
865*b1cdbd2cSJim Jagielski     returned.  If b is false, the buffer is filled with the string "false" and
866*b1cdbd2cSJim Jagielski     6 is returned.  This function cannot be used for language-specific
867*b1cdbd2cSJim Jagielski     operations.
868*b1cdbd2cSJim Jagielski 
869*b1cdbd2cSJim Jagielski     @param str
870*b1cdbd2cSJim Jagielski     a buffer that is big enough to hold the result and the terminating NUL
871*b1cdbd2cSJim Jagielski     character.  You should use the RTL_USTR_MAX_VALUEOFBOOLEAN define to
872*b1cdbd2cSJim Jagielski     create a buffer that is big enough.
873*b1cdbd2cSJim Jagielski 
874*b1cdbd2cSJim Jagielski     @param b
875*b1cdbd2cSJim Jagielski     a boolean value.
876*b1cdbd2cSJim Jagielski 
877*b1cdbd2cSJim Jagielski     @return
878*b1cdbd2cSJim Jagielski     the length of the string.
879*b1cdbd2cSJim Jagielski  */
880*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_valueOfBoolean( sal_Unicode * str, sal_Bool b ) SAL_THROW_EXTERN_C();
881*b1cdbd2cSJim Jagielski #define RTL_USTR_MAX_VALUEOFBOOLEAN RTL_STR_MAX_VALUEOFBOOLEAN
882*b1cdbd2cSJim Jagielski 
883*b1cdbd2cSJim Jagielski /** Create the string representation of a character.
884*b1cdbd2cSJim Jagielski 
885*b1cdbd2cSJim Jagielski     @param str
886*b1cdbd2cSJim Jagielski     a buffer that is big enough to hold the result and the terminating NUL
887*b1cdbd2cSJim Jagielski     character.  You should use the RTL_USTR_MAX_VALUEOFCHAR define to create a
888*b1cdbd2cSJim Jagielski     buffer that is big enough.
889*b1cdbd2cSJim Jagielski 
890*b1cdbd2cSJim Jagielski     @param ch
891*b1cdbd2cSJim Jagielski     a character value.
892*b1cdbd2cSJim Jagielski 
893*b1cdbd2cSJim Jagielski     @return
894*b1cdbd2cSJim Jagielski     the length of the string.
895*b1cdbd2cSJim Jagielski  */
896*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_valueOfChar( sal_Unicode * str, sal_Unicode ch ) SAL_THROW_EXTERN_C();
897*b1cdbd2cSJim Jagielski #define RTL_USTR_MAX_VALUEOFCHAR RTL_STR_MAX_VALUEOFCHAR
898*b1cdbd2cSJim Jagielski 
899*b1cdbd2cSJim Jagielski /** Create the string representation of an integer.
900*b1cdbd2cSJim Jagielski 
901*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific operations.
902*b1cdbd2cSJim Jagielski 
903*b1cdbd2cSJim Jagielski     @param str
904*b1cdbd2cSJim Jagielski     a buffer that is big enough to hold the result and the terminating NUL
905*b1cdbd2cSJim Jagielski     character.  You should use the RTL_USTR_MAX_VALUEOFINT32 define to create
906*b1cdbd2cSJim Jagielski     a buffer that is big enough.
907*b1cdbd2cSJim Jagielski 
908*b1cdbd2cSJim Jagielski     @param i
909*b1cdbd2cSJim Jagielski     an integer value.
910*b1cdbd2cSJim Jagielski 
911*b1cdbd2cSJim Jagielski     @param radix
912*b1cdbd2cSJim Jagielski     the radix.  Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
913*b1cdbd2cSJim Jagielski     (36), inclusive.
914*b1cdbd2cSJim Jagielski 
915*b1cdbd2cSJim Jagielski     @return
916*b1cdbd2cSJim Jagielski     the length of the string.
917*b1cdbd2cSJim Jagielski  */
918*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_valueOfInt32( sal_Unicode * str, sal_Int32 i, sal_Int16 radix ) SAL_THROW_EXTERN_C();
919*b1cdbd2cSJim Jagielski #define RTL_USTR_MIN_RADIX          RTL_STR_MIN_RADIX
920*b1cdbd2cSJim Jagielski #define RTL_USTR_MAX_RADIX          RTL_STR_MAX_RADIX
921*b1cdbd2cSJim Jagielski #define RTL_USTR_MAX_VALUEOFINT32   RTL_STR_MAX_VALUEOFINT32
922*b1cdbd2cSJim Jagielski 
923*b1cdbd2cSJim Jagielski /** Create the string representation of a long integer.
924*b1cdbd2cSJim Jagielski 
925*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific operations.
926*b1cdbd2cSJim Jagielski 
927*b1cdbd2cSJim Jagielski     @param str
928*b1cdbd2cSJim Jagielski     a buffer that is big enough to hold the result and the terminating NUL
929*b1cdbd2cSJim Jagielski     character.  You should use the RTL_USTR_MAX_VALUEOFINT64 define to create
930*b1cdbd2cSJim Jagielski     a buffer that is big enough.
931*b1cdbd2cSJim Jagielski 
932*b1cdbd2cSJim Jagielski     @param l
933*b1cdbd2cSJim Jagielski     a long integer value.
934*b1cdbd2cSJim Jagielski 
935*b1cdbd2cSJim Jagielski     @param radix
936*b1cdbd2cSJim Jagielski     the radix.  Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
937*b1cdbd2cSJim Jagielski     (36), inclusive.
938*b1cdbd2cSJim Jagielski 
939*b1cdbd2cSJim Jagielski     @return
940*b1cdbd2cSJim Jagielski     the length of the string.
941*b1cdbd2cSJim Jagielski  */
942*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_valueOfInt64( sal_Unicode * str, sal_Int64 l, sal_Int16 radix ) SAL_THROW_EXTERN_C();
943*b1cdbd2cSJim Jagielski #define RTL_USTR_MAX_VALUEOFINT64 RTL_STR_MAX_VALUEOFINT64
944*b1cdbd2cSJim Jagielski 
945*b1cdbd2cSJim Jagielski /** Create the string representation of a float.
946*b1cdbd2cSJim Jagielski 
947*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific conversion.
948*b1cdbd2cSJim Jagielski 
949*b1cdbd2cSJim Jagielski     @param str
950*b1cdbd2cSJim Jagielski     a buffer that is big enough to hold the result and the terminating NUL
951*b1cdbd2cSJim Jagielski     character.  You should use the RTL_USTR_MAX_VALUEOFFLOAT define to create
952*b1cdbd2cSJim Jagielski     a buffer that is big enough.
953*b1cdbd2cSJim Jagielski 
954*b1cdbd2cSJim Jagielski     @param f
955*b1cdbd2cSJim Jagielski     a float value.
956*b1cdbd2cSJim Jagielski 
957*b1cdbd2cSJim Jagielski     @return
958*b1cdbd2cSJim Jagielski     the length of the string.
959*b1cdbd2cSJim Jagielski  */
960*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_valueOfFloat( sal_Unicode * str, float f ) SAL_THROW_EXTERN_C();
961*b1cdbd2cSJim Jagielski #define RTL_USTR_MAX_VALUEOFFLOAT RTL_STR_MAX_VALUEOFFLOAT
962*b1cdbd2cSJim Jagielski 
963*b1cdbd2cSJim Jagielski /** Create the string representation of a double.
964*b1cdbd2cSJim Jagielski 
965*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific conversion.
966*b1cdbd2cSJim Jagielski 
967*b1cdbd2cSJim Jagielski     @param str
968*b1cdbd2cSJim Jagielski     a buffer that is big enough to hold the result and the terminating NUL
969*b1cdbd2cSJim Jagielski     character.  You should use the RTL_USTR_MAX_VALUEOFDOUBLE define to create
970*b1cdbd2cSJim Jagielski     a buffer that is big enough.
971*b1cdbd2cSJim Jagielski 
972*b1cdbd2cSJim Jagielski     @param d
973*b1cdbd2cSJim Jagielski     a double value.
974*b1cdbd2cSJim Jagielski 
975*b1cdbd2cSJim Jagielski     @return
976*b1cdbd2cSJim Jagielski     the length of the string.
977*b1cdbd2cSJim Jagielski  */
978*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_valueOfDouble( sal_Unicode * str, double d ) SAL_THROW_EXTERN_C();
979*b1cdbd2cSJim Jagielski #define RTL_USTR_MAX_VALUEOFDOUBLE RTL_STR_MAX_VALUEOFDOUBLE
980*b1cdbd2cSJim Jagielski 
981*b1cdbd2cSJim Jagielski /** Interpret a string as a boolean.
982*b1cdbd2cSJim Jagielski 
983*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific conversion.  The string
984*b1cdbd2cSJim Jagielski     must be null-terminated.
985*b1cdbd2cSJim Jagielski 
986*b1cdbd2cSJim Jagielski     @param str
987*b1cdbd2cSJim Jagielski     a null-terminated string.
988*b1cdbd2cSJim Jagielski 
989*b1cdbd2cSJim Jagielski     @return
990*b1cdbd2cSJim Jagielski     true if the string is "1" or "true" in any ASCII case, false otherwise.
991*b1cdbd2cSJim Jagielski  */
992*b1cdbd2cSJim Jagielski sal_Bool SAL_CALL rtl_ustr_toBoolean( const sal_Unicode * str ) SAL_THROW_EXTERN_C();
993*b1cdbd2cSJim Jagielski 
994*b1cdbd2cSJim Jagielski /** Interpret a string as an integer.
995*b1cdbd2cSJim Jagielski 
996*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific conversion.  The string
997*b1cdbd2cSJim Jagielski     must be null-terminated.
998*b1cdbd2cSJim Jagielski 
999*b1cdbd2cSJim Jagielski     @param str
1000*b1cdbd2cSJim Jagielski     a null-terminated string.
1001*b1cdbd2cSJim Jagielski 
1002*b1cdbd2cSJim Jagielski     @param radix
1003*b1cdbd2cSJim Jagielski     the radix.  Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
1004*b1cdbd2cSJim Jagielski     (36), inclusive.
1005*b1cdbd2cSJim Jagielski 
1006*b1cdbd2cSJim Jagielski     @return
1007*b1cdbd2cSJim Jagielski     the integer value represented by the string, or 0 if the string does not
1008*b1cdbd2cSJim Jagielski     represent an integer.
1009*b1cdbd2cSJim Jagielski  */
1010*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_ustr_toInt32( const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1011*b1cdbd2cSJim Jagielski 
1012*b1cdbd2cSJim Jagielski /** Interpret a string as a long integer.
1013*b1cdbd2cSJim Jagielski 
1014*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific conversion.  The string
1015*b1cdbd2cSJim Jagielski     must be null-terminated.
1016*b1cdbd2cSJim Jagielski 
1017*b1cdbd2cSJim Jagielski     @param str
1018*b1cdbd2cSJim Jagielski     a null-terminated string.
1019*b1cdbd2cSJim Jagielski 
1020*b1cdbd2cSJim Jagielski     @param radix
1021*b1cdbd2cSJim Jagielski     the radix.  Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
1022*b1cdbd2cSJim Jagielski     (36), inclusive.
1023*b1cdbd2cSJim Jagielski 
1024*b1cdbd2cSJim Jagielski     @return
1025*b1cdbd2cSJim Jagielski     the long integer value represented by the string, or 0 if the string does
1026*b1cdbd2cSJim Jagielski     not represent a long integer.
1027*b1cdbd2cSJim Jagielski  */
1028*b1cdbd2cSJim Jagielski sal_Int64 SAL_CALL rtl_ustr_toInt64( const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1029*b1cdbd2cSJim Jagielski 
1030*b1cdbd2cSJim Jagielski /** Interpret a string as a float.
1031*b1cdbd2cSJim Jagielski 
1032*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific conversion.  The string
1033*b1cdbd2cSJim Jagielski     must be null-terminated.
1034*b1cdbd2cSJim Jagielski 
1035*b1cdbd2cSJim Jagielski     @param str
1036*b1cdbd2cSJim Jagielski     a null-terminated string.
1037*b1cdbd2cSJim Jagielski 
1038*b1cdbd2cSJim Jagielski     @return
1039*b1cdbd2cSJim Jagielski     the float value represented by the string, or 0.0 if the string does not
1040*b1cdbd2cSJim Jagielski     represent a float.
1041*b1cdbd2cSJim Jagielski  */
1042*b1cdbd2cSJim Jagielski float SAL_CALL rtl_ustr_toFloat( const sal_Unicode * str ) SAL_THROW_EXTERN_C();
1043*b1cdbd2cSJim Jagielski 
1044*b1cdbd2cSJim Jagielski /** Interpret a string as a double.
1045*b1cdbd2cSJim Jagielski 
1046*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific conversion.  The string
1047*b1cdbd2cSJim Jagielski     must be null-terminated.
1048*b1cdbd2cSJim Jagielski 
1049*b1cdbd2cSJim Jagielski     @param str
1050*b1cdbd2cSJim Jagielski     a null-terminated string.
1051*b1cdbd2cSJim Jagielski 
1052*b1cdbd2cSJim Jagielski     @return
1053*b1cdbd2cSJim Jagielski     the float value represented by the string, or 0.0 if the string does not
1054*b1cdbd2cSJim Jagielski     represent a double.
1055*b1cdbd2cSJim Jagielski  */
1056*b1cdbd2cSJim Jagielski double SAL_CALL rtl_ustr_toDouble( const sal_Unicode * str ) SAL_THROW_EXTERN_C();
1057*b1cdbd2cSJim Jagielski 
1058*b1cdbd2cSJim Jagielski /* ======================================================================= */
1059*b1cdbd2cSJim Jagielski 
1060*b1cdbd2cSJim Jagielski #if defined( SAL_W32) ||  defined(SAL_OS2)
1061*b1cdbd2cSJim Jagielski #pragma pack(push, 4)
1062*b1cdbd2cSJim Jagielski #endif
1063*b1cdbd2cSJim Jagielski 
1064*b1cdbd2cSJim Jagielski /** The implementation of a Unicode string.
1065*b1cdbd2cSJim Jagielski 
1066*b1cdbd2cSJim Jagielski     @internal
1067*b1cdbd2cSJim Jagielski */
1068*b1cdbd2cSJim Jagielski typedef struct _rtl_uString
1069*b1cdbd2cSJim Jagielski {
1070*b1cdbd2cSJim Jagielski     oslInterlockedCount refCount; /* opaque */
1071*b1cdbd2cSJim Jagielski     sal_Int32           length;
1072*b1cdbd2cSJim Jagielski     sal_Unicode         buffer[1];
1073*b1cdbd2cSJim Jagielski } rtl_uString;
1074*b1cdbd2cSJim Jagielski 
1075*b1cdbd2cSJim Jagielski #if defined( SAL_W32) ||  defined(SAL_OS2)
1076*b1cdbd2cSJim Jagielski #pragma pack(pop)
1077*b1cdbd2cSJim Jagielski #endif
1078*b1cdbd2cSJim Jagielski 
1079*b1cdbd2cSJim Jagielski /* ----------------------------------------------------------------------- */
1080*b1cdbd2cSJim Jagielski 
1081*b1cdbd2cSJim Jagielski /** Increment the reference count of a string.
1082*b1cdbd2cSJim Jagielski 
1083*b1cdbd2cSJim Jagielski     @param str
1084*b1cdbd2cSJim Jagielski     a string.
1085*b1cdbd2cSJim Jagielski  */
1086*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_acquire( rtl_uString * str ) SAL_THROW_EXTERN_C();
1087*b1cdbd2cSJim Jagielski 
1088*b1cdbd2cSJim Jagielski /** Decrement the reference count of a string.
1089*b1cdbd2cSJim Jagielski 
1090*b1cdbd2cSJim Jagielski     If the count goes to zero than the string data is deleted.
1091*b1cdbd2cSJim Jagielski 
1092*b1cdbd2cSJim Jagielski     @param str
1093*b1cdbd2cSJim Jagielski     a string.
1094*b1cdbd2cSJim Jagielski  */
1095*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_release( rtl_uString * str ) SAL_THROW_EXTERN_C();
1096*b1cdbd2cSJim Jagielski 
1097*b1cdbd2cSJim Jagielski /** Allocate a new string containing no characters.
1098*b1cdbd2cSJim Jagielski 
1099*b1cdbd2cSJim Jagielski     @param newStr
1100*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1101*b1cdbd2cSJim Jagielski     string.
1102*b1cdbd2cSJim Jagielski  */
1103*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_new( rtl_uString ** newStr ) SAL_THROW_EXTERN_C();
1104*b1cdbd2cSJim Jagielski 
1105*b1cdbd2cSJim Jagielski /** Allocate a new string containing space for a given number of characters.
1106*b1cdbd2cSJim Jagielski 
1107*b1cdbd2cSJim Jagielski     If len is greater than zero, the reference count of the new string will be
1108*b1cdbd2cSJim Jagielski     1.  The values of all characters are set to 0 and the length of the string
1109*b1cdbd2cSJim Jagielski     is 0.  This function does not handle out-of-memory conditions.
1110*b1cdbd2cSJim Jagielski 
1111*b1cdbd2cSJim Jagielski     @param newStr
1112*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1113*b1cdbd2cSJim Jagielski     string.
1114*b1cdbd2cSJim Jagielski 
1115*b1cdbd2cSJim Jagielski     @param len
1116*b1cdbd2cSJim Jagielski     the number of characters.
1117*b1cdbd2cSJim Jagielski  */
1118*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_new_WithLength( rtl_uString ** newStr, sal_Int32 nLen ) SAL_THROW_EXTERN_C();
1119*b1cdbd2cSJim Jagielski 
1120*b1cdbd2cSJim Jagielski /** Allocate a new string that contains a copy of another string.
1121*b1cdbd2cSJim Jagielski 
1122*b1cdbd2cSJim Jagielski     If the length of value is greater than zero, the reference count of the
1123*b1cdbd2cSJim Jagielski     new string will be 1.  This function does not handle out-of-memory
1124*b1cdbd2cSJim Jagielski     conditions.
1125*b1cdbd2cSJim Jagielski 
1126*b1cdbd2cSJim Jagielski     @param newStr
1127*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1128*b1cdbd2cSJim Jagielski     string.
1129*b1cdbd2cSJim Jagielski 
1130*b1cdbd2cSJim Jagielski     @param value
1131*b1cdbd2cSJim Jagielski     a valid string.
1132*b1cdbd2cSJim Jagielski  */
1133*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_newFromString( rtl_uString ** newStr, const rtl_uString * value ) SAL_THROW_EXTERN_C();
1134*b1cdbd2cSJim Jagielski 
1135*b1cdbd2cSJim Jagielski /** Allocate a new string that contains a copy of a character array.
1136*b1cdbd2cSJim Jagielski 
1137*b1cdbd2cSJim Jagielski     If the length of value is greater than zero, the reference count of the
1138*b1cdbd2cSJim Jagielski     new string will be 1.  This function does not handle out-of-memory
1139*b1cdbd2cSJim Jagielski     conditions.
1140*b1cdbd2cSJim Jagielski 
1141*b1cdbd2cSJim Jagielski     @param newStr
1142*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1143*b1cdbd2cSJim Jagielski     string.
1144*b1cdbd2cSJim Jagielski 
1145*b1cdbd2cSJim Jagielski     @param value
1146*b1cdbd2cSJim Jagielski     a null-terminated character array.
1147*b1cdbd2cSJim Jagielski  */
1148*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_newFromStr( rtl_uString ** newStr, const sal_Unicode * value ) SAL_THROW_EXTERN_C();
1149*b1cdbd2cSJim Jagielski 
1150*b1cdbd2cSJim Jagielski /** Allocate a new string that contains a copy of a character array.
1151*b1cdbd2cSJim Jagielski 
1152*b1cdbd2cSJim Jagielski     If the length of value is greater than zero, the reference count of the
1153*b1cdbd2cSJim Jagielski     new string will be 1.  This function does not handle out-of-memory
1154*b1cdbd2cSJim Jagielski     conditions.
1155*b1cdbd2cSJim Jagielski 
1156*b1cdbd2cSJim Jagielski     @param newStr
1157*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1158*b1cdbd2cSJim Jagielski     string.
1159*b1cdbd2cSJim Jagielski 
1160*b1cdbd2cSJim Jagielski     @param value
1161*b1cdbd2cSJim Jagielski     a character array.  Need not be null-terminated, but must be at least as
1162*b1cdbd2cSJim Jagielski     long as the specified len.
1163*b1cdbd2cSJim Jagielski 
1164*b1cdbd2cSJim Jagielski     @param len
1165*b1cdbd2cSJim Jagielski     the length of the character array.
1166*b1cdbd2cSJim Jagielski  */
1167*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_newFromStr_WithLength( rtl_uString ** newStr, const sal_Unicode * value, sal_Int32 len ) SAL_THROW_EXTERN_C();
1168*b1cdbd2cSJim Jagielski 
1169*b1cdbd2cSJim Jagielski /** Allocate a new string that contains a copy of a character array.
1170*b1cdbd2cSJim Jagielski 
1171*b1cdbd2cSJim Jagielski     If the length of value is greater than zero, the reference count of the
1172*b1cdbd2cSJim Jagielski     new string will be 1.  This function does not handle out-of-memory
1173*b1cdbd2cSJim Jagielski     conditions.
1174*b1cdbd2cSJim Jagielski 
1175*b1cdbd2cSJim Jagielski     Since this function is optimized for performance, the ASCII character
1176*b1cdbd2cSJim Jagielski     values are not converted in any way.  The caller has to make sure that
1177*b1cdbd2cSJim Jagielski     all ASCII characters are in the allowed range of 0 and 127, inclusive.
1178*b1cdbd2cSJim Jagielski 
1179*b1cdbd2cSJim Jagielski     @param newStr
1180*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1181*b1cdbd2cSJim Jagielski     string.
1182*b1cdbd2cSJim Jagielski 
1183*b1cdbd2cSJim Jagielski     @param value
1184*b1cdbd2cSJim Jagielski     a null-terminated ASCII character array.
1185*b1cdbd2cSJim Jagielski  */
1186*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_newFromAscii( rtl_uString ** newStr, const sal_Char * value ) SAL_THROW_EXTERN_C();
1187*b1cdbd2cSJim Jagielski 
1188*b1cdbd2cSJim Jagielski /** Allocate a new string from an array of Unicode code points.
1189*b1cdbd2cSJim Jagielski 
1190*b1cdbd2cSJim Jagielski     @param newString
1191*b1cdbd2cSJim Jagielski     a non-null pointer to a (possibly null) rtl_uString pointer, which (if
1192*b1cdbd2cSJim Jagielski     non-null) will have been passed to rtl_uString_release before the function
1193*b1cdbd2cSJim Jagielski     returns.  Upon return, points to the newly allocated string or to null if
1194*b1cdbd2cSJim Jagielski     there was either an out-of-memory condition or the resulting number of
1195*b1cdbd2cSJim Jagielski     UTF-16 code units would have been larger than SAL_MAX_INT32.  The newly
1196*b1cdbd2cSJim Jagielski     allocated string (if any) must ultimately be passed to rtl_uString_release.
1197*b1cdbd2cSJim Jagielski 
1198*b1cdbd2cSJim Jagielski     @param codePoints
1199*b1cdbd2cSJim Jagielski     an array of at least codePointCount code points, which each must be in the
1200*b1cdbd2cSJim Jagielski     range from 0 to 0x10FFFF, inclusive.  May be null if codePointCount is zero.
1201*b1cdbd2cSJim Jagielski 
1202*b1cdbd2cSJim Jagielski     @param codePointCount
1203*b1cdbd2cSJim Jagielski     the non-negative number of code points.
1204*b1cdbd2cSJim Jagielski 
1205*b1cdbd2cSJim Jagielski     @since UDK 3.2.7
1206*b1cdbd2cSJim Jagielski */
1207*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_newFromCodePoints(
1208*b1cdbd2cSJim Jagielski     rtl_uString ** newString, sal_uInt32 const * codePoints,
1209*b1cdbd2cSJim Jagielski     sal_Int32 codePointCount) SAL_THROW_EXTERN_C();
1210*b1cdbd2cSJim Jagielski 
1211*b1cdbd2cSJim Jagielski /** Assign a new value to a string.
1212*b1cdbd2cSJim Jagielski 
1213*b1cdbd2cSJim Jagielski     First releases any value str might currently hold, then acquires
1214*b1cdbd2cSJim Jagielski     rightValue.
1215*b1cdbd2cSJim Jagielski 
1216*b1cdbd2cSJim Jagielski     @param str
1217*b1cdbd2cSJim Jagielski     pointer to the string.  The pointed-to data must be null or a valid
1218*b1cdbd2cSJim Jagielski     string.
1219*b1cdbd2cSJim Jagielski 
1220*b1cdbd2cSJim Jagielski     @param rightValue
1221*b1cdbd2cSJim Jagielski     a valid string.
1222*b1cdbd2cSJim Jagielski  */
1223*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_assign( rtl_uString ** str, rtl_uString * rightValue ) SAL_THROW_EXTERN_C();
1224*b1cdbd2cSJim Jagielski 
1225*b1cdbd2cSJim Jagielski /** Return the length of a string.
1226*b1cdbd2cSJim Jagielski 
1227*b1cdbd2cSJim Jagielski     The length is equal to the number of characters in the string.
1228*b1cdbd2cSJim Jagielski 
1229*b1cdbd2cSJim Jagielski     @param str
1230*b1cdbd2cSJim Jagielski     a valid string.
1231*b1cdbd2cSJim Jagielski 
1232*b1cdbd2cSJim Jagielski     @return
1233*b1cdbd2cSJim Jagielski     the length of the string.
1234*b1cdbd2cSJim Jagielski  */
1235*b1cdbd2cSJim Jagielski sal_Int32 SAL_CALL rtl_uString_getLength( const rtl_uString * str ) SAL_THROW_EXTERN_C();
1236*b1cdbd2cSJim Jagielski 
1237*b1cdbd2cSJim Jagielski /** Return a pointer to the underlying character array of a string.
1238*b1cdbd2cSJim Jagielski 
1239*b1cdbd2cSJim Jagielski     @param str
1240*b1cdbd2cSJim Jagielski     a valid string.
1241*b1cdbd2cSJim Jagielski 
1242*b1cdbd2cSJim Jagielski     @return
1243*b1cdbd2cSJim Jagielski     a pointer to the null-terminated character array.
1244*b1cdbd2cSJim Jagielski  */
1245*b1cdbd2cSJim Jagielski sal_Unicode * SAL_CALL rtl_uString_getStr( rtl_uString * str ) SAL_THROW_EXTERN_C();
1246*b1cdbd2cSJim Jagielski 
1247*b1cdbd2cSJim Jagielski /** Create a new string that is the concatenation of two other strings.
1248*b1cdbd2cSJim Jagielski 
1249*b1cdbd2cSJim Jagielski     The new string does not necessarily have a reference count of 1 (in cases
1250*b1cdbd2cSJim Jagielski     where one of the two other strings is empty), so it must not be modified
1251*b1cdbd2cSJim Jagielski     without checking the reference count.  This function does not handle
1252*b1cdbd2cSJim Jagielski     out-of-memory conditions.
1253*b1cdbd2cSJim Jagielski 
1254*b1cdbd2cSJim Jagielski     @param newStr
1255*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1256*b1cdbd2cSJim Jagielski     string.
1257*b1cdbd2cSJim Jagielski 
1258*b1cdbd2cSJim Jagielski     @param left
1259*b1cdbd2cSJim Jagielski     a valid string.
1260*b1cdbd2cSJim Jagielski 
1261*b1cdbd2cSJim Jagielski     @param right
1262*b1cdbd2cSJim Jagielski     a valid string.
1263*b1cdbd2cSJim Jagielski  */
1264*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_newConcat( rtl_uString ** newStr, rtl_uString * left, rtl_uString * right ) SAL_THROW_EXTERN_C();
1265*b1cdbd2cSJim Jagielski 
1266*b1cdbd2cSJim Jagielski /** Create a new string by replacing a substring of another string.
1267*b1cdbd2cSJim Jagielski 
1268*b1cdbd2cSJim Jagielski     The new string results from replacing a number of characters (count),
1269*b1cdbd2cSJim Jagielski     starting at the specified position (index) in the original string (str),
1270*b1cdbd2cSJim Jagielski     with some new substring (subStr).  If subStr is null, than only a number
1271*b1cdbd2cSJim Jagielski     of characters is deleted.
1272*b1cdbd2cSJim Jagielski 
1273*b1cdbd2cSJim Jagielski     The new string does not necessarily have a reference count of 1, so it
1274*b1cdbd2cSJim Jagielski     must not be modified without checking the reference count.  This function
1275*b1cdbd2cSJim Jagielski     does not handle out-of-memory conditions.
1276*b1cdbd2cSJim Jagielski 
1277*b1cdbd2cSJim Jagielski     @param newStr
1278*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1279*b1cdbd2cSJim Jagielski     string.
1280*b1cdbd2cSJim Jagielski 
1281*b1cdbd2cSJim Jagielski     @param str
1282*b1cdbd2cSJim Jagielski     a valid string.
1283*b1cdbd2cSJim Jagielski 
1284*b1cdbd2cSJim Jagielski     @param index
1285*b1cdbd2cSJim Jagielski     the index into str at which to start replacement.  Must be between 0 and
1286*b1cdbd2cSJim Jagielski     the length of str, inclusive.
1287*b1cdbd2cSJim Jagielski 
1288*b1cdbd2cSJim Jagielski     @param count
1289*b1cdbd2cSJim Jagielski     the number of charcters to remove.  Must not be negative, and the sum of
1290*b1cdbd2cSJim Jagielski     index and count must not exceed the length of str.
1291*b1cdbd2cSJim Jagielski 
1292*b1cdbd2cSJim Jagielski     @param subStr
1293*b1cdbd2cSJim Jagielski     either null or a valid string to be inserted.
1294*b1cdbd2cSJim Jagielski  */
1295*b1cdbd2cSJim Jagielski 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();
1296*b1cdbd2cSJim Jagielski 
1297*b1cdbd2cSJim Jagielski /** Create a new string by replacing all occurrences of a single character
1298*b1cdbd2cSJim Jagielski     within another string.
1299*b1cdbd2cSJim Jagielski 
1300*b1cdbd2cSJim Jagielski     The new string results from replacing all occurrences of oldChar in str
1301*b1cdbd2cSJim Jagielski     with newChar.
1302*b1cdbd2cSJim Jagielski 
1303*b1cdbd2cSJim Jagielski     The new string does not necessarily have a reference count of 1 (in cases
1304*b1cdbd2cSJim Jagielski     where oldChar does not occur in str), so it must not be modified without
1305*b1cdbd2cSJim Jagielski     checking the reference count.  This function does not handle out-of-memory
1306*b1cdbd2cSJim Jagielski     conditions.
1307*b1cdbd2cSJim Jagielski 
1308*b1cdbd2cSJim Jagielski     @param newStr
1309*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1310*b1cdbd2cSJim Jagielski     string.
1311*b1cdbd2cSJim Jagielski 
1312*b1cdbd2cSJim Jagielski     @param str
1313*b1cdbd2cSJim Jagielski     a valid string.
1314*b1cdbd2cSJim Jagielski 
1315*b1cdbd2cSJim Jagielski     @param oldChar
1316*b1cdbd2cSJim Jagielski     the old character.
1317*b1cdbd2cSJim Jagielski 
1318*b1cdbd2cSJim Jagielski     @param newChar
1319*b1cdbd2cSJim Jagielski     the new character.
1320*b1cdbd2cSJim Jagielski  */
1321*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_newReplace( rtl_uString ** newStr, rtl_uString * str, sal_Unicode oldChar, sal_Unicode newChar ) SAL_THROW_EXTERN_C();
1322*b1cdbd2cSJim Jagielski 
1323*b1cdbd2cSJim Jagielski /** Create a new string by converting all ASCII uppercase letters to lowercase
1324*b1cdbd2cSJim Jagielski     within another string.
1325*b1cdbd2cSJim Jagielski 
1326*b1cdbd2cSJim Jagielski     The new string results from replacing all characters with values between
1327*b1cdbd2cSJim Jagielski     65 and 90 (ASCII A--Z) by values between 97 and 122 (ASCII a--z).
1328*b1cdbd2cSJim Jagielski 
1329*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific conversion.  The new
1330*b1cdbd2cSJim Jagielski     string does not necessarily have a reference count of 1 (in cases where
1331*b1cdbd2cSJim Jagielski     no characters need to be converted), so it must not be modified without
1332*b1cdbd2cSJim Jagielski     checking the reference count.  This function does not handle out-of-memory
1333*b1cdbd2cSJim Jagielski     conditions.
1334*b1cdbd2cSJim Jagielski 
1335*b1cdbd2cSJim Jagielski     @param newStr
1336*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1337*b1cdbd2cSJim Jagielski     string.
1338*b1cdbd2cSJim Jagielski 
1339*b1cdbd2cSJim Jagielski     @param str
1340*b1cdbd2cSJim Jagielski     a valid string.
1341*b1cdbd2cSJim Jagielski  */
1342*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_newToAsciiLowerCase( rtl_uString ** newStr, rtl_uString * str ) SAL_THROW_EXTERN_C();
1343*b1cdbd2cSJim Jagielski 
1344*b1cdbd2cSJim Jagielski /** Create a new string by converting all ASCII lowercase letters to uppercase
1345*b1cdbd2cSJim Jagielski     within another string.
1346*b1cdbd2cSJim Jagielski 
1347*b1cdbd2cSJim Jagielski     The new string results from replacing all characters with values between
1348*b1cdbd2cSJim Jagielski     97 and 122 (ASCII a--z) by values between 65 and 90 (ASCII A--Z).
1349*b1cdbd2cSJim Jagielski 
1350*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific conversion.  The new
1351*b1cdbd2cSJim Jagielski     string does not necessarily have a reference count of 1 (in cases where
1352*b1cdbd2cSJim Jagielski     no characters need to be converted), so it must not be modified without
1353*b1cdbd2cSJim Jagielski     checking the reference count.  This function does not handle out-of-memory
1354*b1cdbd2cSJim Jagielski     conditions.
1355*b1cdbd2cSJim Jagielski 
1356*b1cdbd2cSJim Jagielski     @param newStr
1357*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1358*b1cdbd2cSJim Jagielski     string.
1359*b1cdbd2cSJim Jagielski 
1360*b1cdbd2cSJim Jagielski     @param str
1361*b1cdbd2cSJim Jagielski     a valid string.
1362*b1cdbd2cSJim Jagielski  */
1363*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_newToAsciiUpperCase( rtl_uString ** newStr, rtl_uString * str ) SAL_THROW_EXTERN_C();
1364*b1cdbd2cSJim Jagielski 
1365*b1cdbd2cSJim Jagielski /** Create a new string by removing white space from both ends of another
1366*b1cdbd2cSJim Jagielski     string.
1367*b1cdbd2cSJim Jagielski 
1368*b1cdbd2cSJim Jagielski     The new string results from removing all characters with values less than
1369*b1cdbd2cSJim Jagielski     or equal to 32 (the space character) form both ends of str.
1370*b1cdbd2cSJim Jagielski 
1371*b1cdbd2cSJim Jagielski     This function cannot be used for language-specific conversion.  The new
1372*b1cdbd2cSJim Jagielski     string does not necessarily have a reference count of 1 (in cases where
1373*b1cdbd2cSJim Jagielski     no characters need to be removed), so it must not be modified without
1374*b1cdbd2cSJim Jagielski     checking the reference count.  This function does not handle out-of-memory
1375*b1cdbd2cSJim Jagielski     conditions.
1376*b1cdbd2cSJim Jagielski 
1377*b1cdbd2cSJim Jagielski     @param newStr
1378*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1379*b1cdbd2cSJim Jagielski     string.
1380*b1cdbd2cSJim Jagielski 
1381*b1cdbd2cSJim Jagielski     @param str
1382*b1cdbd2cSJim Jagielski     a valid string.
1383*b1cdbd2cSJim Jagielski  */
1384*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_newTrim( rtl_uString ** newStr, rtl_uString * str ) SAL_THROW_EXTERN_C();
1385*b1cdbd2cSJim Jagielski 
1386*b1cdbd2cSJim Jagielski /** Create a new string by extracting a single token from another string.
1387*b1cdbd2cSJim Jagielski 
1388*b1cdbd2cSJim Jagielski     Starting at index, the token's next token is searched for.  If there is no
1389*b1cdbd2cSJim Jagielski     such token, the result is an empty string.  Otherwise, all characters from
1390*b1cdbd2cSJim Jagielski     the start of that token and up to, but not including the next occurrence
1391*b1cdbd2cSJim Jagielski     of cTok make up the resulting token.  The return value is the position of
1392*b1cdbd2cSJim Jagielski     the next token, or -1 if no more tokens follow.
1393*b1cdbd2cSJim Jagielski 
1394*b1cdbd2cSJim Jagielski     Example code could look like
1395*b1cdbd2cSJim Jagielski       rtl_uString * pToken = NULL;
1396*b1cdbd2cSJim Jagielski       sal_Int32 nIndex = 0;
1397*b1cdbd2cSJim Jagielski       do
1398*b1cdbd2cSJim Jagielski       {
1399*b1cdbd2cSJim Jagielski           ...
1400*b1cdbd2cSJim Jagielski           nIndex = rtl_uString_getToken(&pToken, pStr, 0, ';', nIndex);
1401*b1cdbd2cSJim Jagielski           ...
1402*b1cdbd2cSJim Jagielski       }
1403*b1cdbd2cSJim Jagielski       while (nIndex >= 0);
1404*b1cdbd2cSJim Jagielski 
1405*b1cdbd2cSJim Jagielski     The new string does not necessarily have a reference count of 1, so it
1406*b1cdbd2cSJim Jagielski     must not be modified without checking the reference count.  This function
1407*b1cdbd2cSJim Jagielski     does not handle out-of-memory conditions.
1408*b1cdbd2cSJim Jagielski 
1409*b1cdbd2cSJim Jagielski     @param newStr
1410*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1411*b1cdbd2cSJim Jagielski     string.  If either token or index is negative, an empty token is stored in
1412*b1cdbd2cSJim Jagielski     newStr (and -1 is returned).
1413*b1cdbd2cSJim Jagielski 
1414*b1cdbd2cSJim Jagielski     @param str
1415*b1cdbd2cSJim Jagielski     a valid string.
1416*b1cdbd2cSJim Jagielski 
1417*b1cdbd2cSJim Jagielski     @param token
1418*b1cdbd2cSJim Jagielski     the number of the token to return, starting at index.
1419*b1cdbd2cSJim Jagielski 
1420*b1cdbd2cSJim Jagielski     @param cTok
1421*b1cdbd2cSJim Jagielski     the character that seperates the tokens.
1422*b1cdbd2cSJim Jagielski 
1423*b1cdbd2cSJim Jagielski     @param index
1424*b1cdbd2cSJim Jagielski     the position at which searching for the token starts.  Must not be greater
1425*b1cdbd2cSJim Jagielski     than the length of str.
1426*b1cdbd2cSJim Jagielski 
1427*b1cdbd2cSJim Jagielski     @return
1428*b1cdbd2cSJim Jagielski     the index of the next token, or -1 if no more tokens follow.
1429*b1cdbd2cSJim Jagielski  */
1430*b1cdbd2cSJim Jagielski 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();
1431*b1cdbd2cSJim Jagielski 
1432*b1cdbd2cSJim Jagielski /* ======================================================================= */
1433*b1cdbd2cSJim Jagielski 
1434*b1cdbd2cSJim Jagielski /** Supply an ASCII string literal together with its length and text encoding.
1435*b1cdbd2cSJim Jagielski 
1436*b1cdbd2cSJim Jagielski     This macro can be used to compute (some of) the arguments in function calls
1437*b1cdbd2cSJim Jagielski     like rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("foo")).
1438*b1cdbd2cSJim Jagielski 
1439*b1cdbd2cSJim Jagielski     @param constAsciiStr
1440*b1cdbd2cSJim Jagielski     must be an expression of type "(possibly cv-qualified reference to) array of
1441*b1cdbd2cSJim Jagielski     (possibly cv-qualified) char."  Each element of the referenced array must
1442*b1cdbd2cSJim Jagielski     represent an ASCII value in the range 0x00--0x7F.  The last element of the
1443*b1cdbd2cSJim Jagielski     referenced array is not considered part of the represented ASCII string, and
1444*b1cdbd2cSJim Jagielski     its value should be 0x00.  Depending on where this macro is used, the nature
1445*b1cdbd2cSJim Jagielski     of the supplied expression might be further restricted.
1446*b1cdbd2cSJim Jagielski */
1447*b1cdbd2cSJim Jagielski #define RTL_CONSTASCII_USTRINGPARAM( constAsciiStr ) constAsciiStr, ((sal_Int32)(sizeof(constAsciiStr)-1)), RTL_TEXTENCODING_ASCII_US
1448*b1cdbd2cSJim Jagielski 
1449*b1cdbd2cSJim Jagielski /* ======================================================================= */
1450*b1cdbd2cSJim Jagielski 
1451*b1cdbd2cSJim Jagielski /* predefined constants for String-Conversion */
1452*b1cdbd2cSJim Jagielski #define OSTRING_TO_OUSTRING_CVTFLAGS    (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |\
1453*b1cdbd2cSJim Jagielski                                          RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |\
1454*b1cdbd2cSJim Jagielski                                          RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT)
1455*b1cdbd2cSJim Jagielski 
1456*b1cdbd2cSJim Jagielski /* ----------------------------------------------------------------------- */
1457*b1cdbd2cSJim Jagielski 
1458*b1cdbd2cSJim Jagielski /** Create a new Unicode string by converting a byte string, using a specific
1459*b1cdbd2cSJim Jagielski     text encoding.
1460*b1cdbd2cSJim Jagielski 
1461*b1cdbd2cSJim Jagielski     The lengths of the byte string and the Unicode string may differ (e.g.,
1462*b1cdbd2cSJim Jagielski     for double-byte encodings, UTF-7, UTF-8).
1463*b1cdbd2cSJim Jagielski 
1464*b1cdbd2cSJim Jagielski     If the length of the byte string is greater than zero, the reference count
1465*b1cdbd2cSJim Jagielski     of the new string will be 1.
1466*b1cdbd2cSJim Jagielski 
1467*b1cdbd2cSJim Jagielski     If an out-of-memory condition occurs, newStr will point to a null pointer
1468*b1cdbd2cSJim Jagielski     upon return.
1469*b1cdbd2cSJim Jagielski 
1470*b1cdbd2cSJim Jagielski     @param newStr
1471*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1472*b1cdbd2cSJim Jagielski     string.
1473*b1cdbd2cSJim Jagielski 
1474*b1cdbd2cSJim Jagielski     @param str
1475*b1cdbd2cSJim Jagielski     a byte character array.  Need not be null-terminated, but must be at
1476*b1cdbd2cSJim Jagielski     least as long as the specified len.
1477*b1cdbd2cSJim Jagielski 
1478*b1cdbd2cSJim Jagielski     @param len
1479*b1cdbd2cSJim Jagielski     the length of the byte character array.
1480*b1cdbd2cSJim Jagielski 
1481*b1cdbd2cSJim Jagielski     @param encoding
1482*b1cdbd2cSJim Jagielski     the text encoding to use for conversion.
1483*b1cdbd2cSJim Jagielski 
1484*b1cdbd2cSJim Jagielski     @param convertFlags
1485*b1cdbd2cSJim Jagielski     flags which control the conversion.  Either use
1486*b1cdbd2cSJim Jagielski     OSTRING_TO_OUSTRING_CVTFLAGS, or see
1487*b1cdbd2cSJim Jagielski     <http://udk.openoffice.org/cpp/man/spec/textconversion.html> for more
1488*b1cdbd2cSJim Jagielski     details.
1489*b1cdbd2cSJim Jagielski  */
1490*b1cdbd2cSJim Jagielski 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();
1491*b1cdbd2cSJim Jagielski 
1492*b1cdbd2cSJim Jagielski /* ======================================================================= */
1493*b1cdbd2cSJim Jagielski /* Interning methods */
1494*b1cdbd2cSJim Jagielski 
1495*b1cdbd2cSJim Jagielski /** Return a canonical representation for a string.
1496*b1cdbd2cSJim Jagielski 
1497*b1cdbd2cSJim Jagielski     A pool of strings, initially empty is maintained privately
1498*b1cdbd2cSJim Jagielski     by the string class. On invocation, if present in the pool
1499*b1cdbd2cSJim Jagielski     the original string will be returned. Otherwise this string,
1500*b1cdbd2cSJim Jagielski     or a copy thereof will be added to the pool and returned.
1501*b1cdbd2cSJim Jagielski 
1502*b1cdbd2cSJim Jagielski     @param newStr
1503*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1504*b1cdbd2cSJim Jagielski     string.
1505*b1cdbd2cSJim Jagielski 
1506*b1cdbd2cSJim Jagielski     If an out-of-memory condition occurs, newStr will point to a null pointer
1507*b1cdbd2cSJim Jagielski     upon return.
1508*b1cdbd2cSJim Jagielski 
1509*b1cdbd2cSJim Jagielski     @param str
1510*b1cdbd2cSJim Jagielski     pointer to the string to be interned.
1511*b1cdbd2cSJim Jagielski 
1512*b1cdbd2cSJim Jagielski     @since UDK 3.2.7
1513*b1cdbd2cSJim Jagielski  */
1514*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_intern( rtl_uString ** newStr,
1515*b1cdbd2cSJim Jagielski                                   rtl_uString  * str) SAL_THROW_EXTERN_C();
1516*b1cdbd2cSJim Jagielski 
1517*b1cdbd2cSJim Jagielski /** Return a canonical representation for a string.
1518*b1cdbd2cSJim Jagielski 
1519*b1cdbd2cSJim Jagielski     A pool of strings, initially empty is maintained privately
1520*b1cdbd2cSJim Jagielski     by the string class. On invocation, if present in the pool
1521*b1cdbd2cSJim Jagielski     the original string will be returned. Otherwise this string,
1522*b1cdbd2cSJim Jagielski     or a copy thereof will be added to the pool and returned.
1523*b1cdbd2cSJim Jagielski 
1524*b1cdbd2cSJim Jagielski     @param newStr
1525*b1cdbd2cSJim Jagielski     pointer to the new string.  The pointed-to data must be null or a valid
1526*b1cdbd2cSJim Jagielski     string.
1527*b1cdbd2cSJim Jagielski 
1528*b1cdbd2cSJim Jagielski     If an out-of-memory condition occurs, newStr will point to a null pointer
1529*b1cdbd2cSJim Jagielski     upon return.
1530*b1cdbd2cSJim Jagielski 
1531*b1cdbd2cSJim Jagielski     @param str
1532*b1cdbd2cSJim Jagielski     a byte character array.  Need not be null-terminated, but must be at
1533*b1cdbd2cSJim Jagielski     least as long as the specified len.
1534*b1cdbd2cSJim Jagielski 
1535*b1cdbd2cSJim Jagielski     @param len
1536*b1cdbd2cSJim Jagielski     the length of the byte character array.
1537*b1cdbd2cSJim Jagielski 
1538*b1cdbd2cSJim Jagielski     @param encoding
1539*b1cdbd2cSJim Jagielski     the text encoding to use for conversion.
1540*b1cdbd2cSJim Jagielski 
1541*b1cdbd2cSJim Jagielski     @param convertFlags
1542*b1cdbd2cSJim Jagielski     flags which control the conversion.  Either use
1543*b1cdbd2cSJim Jagielski     OSTRING_TO_OUSTRING_CVTFLAGS, or see
1544*b1cdbd2cSJim Jagielski     <http://udk.openoffice.org/cpp/man/spec/textconversion.html> for more
1545*b1cdbd2cSJim Jagielski     details.
1546*b1cdbd2cSJim Jagielski 
1547*b1cdbd2cSJim Jagielski     @param pInfo
1548*b1cdbd2cSJim Jagielski     pointer to return conversion status in, or NULL.
1549*b1cdbd2cSJim Jagielski 
1550*b1cdbd2cSJim Jagielski     @since UDK 3.2.7
1551*b1cdbd2cSJim Jagielski  */
1552*b1cdbd2cSJim Jagielski void SAL_CALL rtl_uString_internConvert( rtl_uString   ** newStr,
1553*b1cdbd2cSJim Jagielski                                          const sal_Char * str,
1554*b1cdbd2cSJim Jagielski                                          sal_Int32        len,
1555*b1cdbd2cSJim Jagielski                                          rtl_TextEncoding encoding,
1556*b1cdbd2cSJim Jagielski                                          sal_uInt32       convertFlags,
1557*b1cdbd2cSJim Jagielski                                          sal_uInt32      *pInfo) SAL_THROW_EXTERN_C();
1558*b1cdbd2cSJim Jagielski 
1559*b1cdbd2cSJim Jagielski /** Iterate through a string based on code points instead of UTF-16 code units.
1560*b1cdbd2cSJim Jagielski 
1561*b1cdbd2cSJim Jagielski     See Chapter 3 of The Unicode Standard 5.0 (Addison--Wesley, 2006) for
1562*b1cdbd2cSJim Jagielski     definitions of the various terms used in this description.
1563*b1cdbd2cSJim Jagielski 
1564*b1cdbd2cSJim Jagielski     The given string is interpreted as a sequence of zero or more UTF-16 code
1565*b1cdbd2cSJim Jagielski     units.  For each index into this sequence (from zero to one less than the
1566*b1cdbd2cSJim Jagielski     length of the sequence, inclusive), a code point represented starting at the
1567*b1cdbd2cSJim Jagielski     given index is computed as follows:
1568*b1cdbd2cSJim Jagielski 
1569*b1cdbd2cSJim Jagielski     - If the UTF-16 code unit addressed by the index constitutes a well-formed
1570*b1cdbd2cSJim Jagielski     UTF-16 code unit sequence, the computed code point is the scalar value
1571*b1cdbd2cSJim Jagielski     encoded by that UTF-16 code unit sequence.
1572*b1cdbd2cSJim Jagielski 
1573*b1cdbd2cSJim Jagielski     - Otherwise, if the index is at least two UTF-16 code units away from the
1574*b1cdbd2cSJim Jagielski     end of the sequence, and the sequence of two UTF-16 code units addressed by
1575*b1cdbd2cSJim Jagielski     the index constitutes a well-formed UTF-16 code unit sequence, the computed
1576*b1cdbd2cSJim Jagielski     code point is the scalar value encoded by that UTF-16 code unit sequence.
1577*b1cdbd2cSJim Jagielski 
1578*b1cdbd2cSJim Jagielski     - Otherwise, the computed code point is the UTF-16 code unit addressed by
1579*b1cdbd2cSJim Jagielski     the index.  (This last case catches unmatched surrogates as well as indices
1580*b1cdbd2cSJim Jagielski     pointing into the middle of surrogate pairs.)
1581*b1cdbd2cSJim Jagielski 
1582*b1cdbd2cSJim Jagielski     @param string
1583*b1cdbd2cSJim Jagielski     pointer to a valid string; must not be null.
1584*b1cdbd2cSJim Jagielski 
1585*b1cdbd2cSJim Jagielski     @param indexUtf16
1586*b1cdbd2cSJim Jagielski     pointer to a UTF-16 based index into the given string; must not be null.  On
1587*b1cdbd2cSJim Jagielski     entry, the index must be in the range from zero to the length of the string
1588*b1cdbd2cSJim Jagielski     (in UTF-16 code units), inclusive.  Upon successful return, the index will
1589*b1cdbd2cSJim Jagielski     be updated to address the UTF-16 code unit that is the given
1590*b1cdbd2cSJim Jagielski     incrementCodePoints away from the initial index.
1591*b1cdbd2cSJim Jagielski 
1592*b1cdbd2cSJim Jagielski     @param incrementCodePoints
1593*b1cdbd2cSJim Jagielski     the number of code points to move the given *indexUtf16.  If non-negative,
1594*b1cdbd2cSJim Jagielski     moving is done after determining the code point at the index.  If negative,
1595*b1cdbd2cSJim Jagielski     moving is done before determining the code point at the (then updated)
1596*b1cdbd2cSJim Jagielski     index.  The value must be such that the resulting UTF-16 based index is in
1597*b1cdbd2cSJim Jagielski     the range from zero to the length of the string (in UTF-16 code units),
1598*b1cdbd2cSJim Jagielski     inclusive.
1599*b1cdbd2cSJim Jagielski 
1600*b1cdbd2cSJim Jagielski     @return
1601*b1cdbd2cSJim Jagielski     the code point (an integer in the range from 0 to 0x10FFFF, inclusive) that
1602*b1cdbd2cSJim Jagielski     is represented within the string starting at the index computed as follows:
1603*b1cdbd2cSJim Jagielski     If incrementCodePoints is non-negative, the index is the initial value of
1604*b1cdbd2cSJim Jagielski     *indexUtf16; if incrementCodePoints is negative, the index is the updated
1605*b1cdbd2cSJim Jagielski     value of *indexUtf16.  In either case, the computed index must be in the
1606*b1cdbd2cSJim Jagielski     range from zero to one less than the length of the string (in UTF-16 code
1607*b1cdbd2cSJim Jagielski     units), inclusive.
1608*b1cdbd2cSJim Jagielski 
1609*b1cdbd2cSJim Jagielski     @since UDK 3.2.7
1610*b1cdbd2cSJim Jagielski */
1611*b1cdbd2cSJim Jagielski sal_uInt32 SAL_CALL rtl_uString_iterateCodePoints(
1612*b1cdbd2cSJim Jagielski     rtl_uString const * string, sal_Int32 * indexUtf16,
1613*b1cdbd2cSJim Jagielski     sal_Int32 incrementCodePoints);
1614*b1cdbd2cSJim Jagielski 
1615*b1cdbd2cSJim Jagielski /** Converts a byte string to a Unicode string, signalling failure.
1616*b1cdbd2cSJim Jagielski 
1617*b1cdbd2cSJim Jagielski     @param target
1618*b1cdbd2cSJim Jagielski     An out parameter receiving the converted string.  Must not be null itself,
1619*b1cdbd2cSJim Jagielski     and must contain either null or a pointer to a valid rtl_uString; the
1620*b1cdbd2cSJim Jagielski     contents are unspecified if conversion fails (rtl_convertStringToUString
1621*b1cdbd2cSJim Jagielski     returns false).
1622*b1cdbd2cSJim Jagielski 
1623*b1cdbd2cSJim Jagielski     @param source
1624*b1cdbd2cSJim Jagielski     The byte string.  May only be null if length is zero.
1625*b1cdbd2cSJim Jagielski 
1626*b1cdbd2cSJim Jagielski     @param length
1627*b1cdbd2cSJim Jagielski     The length of the byte string.  Must be non-negative.
1628*b1cdbd2cSJim Jagielski 
1629*b1cdbd2cSJim Jagielski     @param encoding
1630*b1cdbd2cSJim Jagielski     The text encoding to convert from.  Must be an octet encoding (i.e.,
1631*b1cdbd2cSJim Jagielski     rtl_isOctetTextEncoding(encoding) must return true).
1632*b1cdbd2cSJim Jagielski 
1633*b1cdbd2cSJim Jagielski     @param flags
1634*b1cdbd2cSJim Jagielski     A combination of RTL_TEXTTOUNICODE_FLAGS that detail how to do the
1635*b1cdbd2cSJim Jagielski     conversion (see rtl_convertTextToUnicode).  RTL_TEXTTOUNICODE_FLAGS_FLUSH
1636*b1cdbd2cSJim Jagielski     need not be included, it is implicitly assumed.  Typical uses are either
1637*b1cdbd2cSJim Jagielski     RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
1638*b1cdbd2cSJim Jagielski     RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
1639*b1cdbd2cSJim Jagielski     RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR (fail if a byte or multi-byte sequence
1640*b1cdbd2cSJim Jagielski     cannot be converted from the source encoding) or
1641*b1cdbd2cSJim Jagielski     OSTRING_TO_OUSTRING_CVTFLAGS (make a best efforts conversion).
1642*b1cdbd2cSJim Jagielski 
1643*b1cdbd2cSJim Jagielski     @return
1644*b1cdbd2cSJim Jagielski     True if the conversion succeeded, false otherwise.
1645*b1cdbd2cSJim Jagielski 
1646*b1cdbd2cSJim Jagielski     @since UDK 3.2.9
1647*b1cdbd2cSJim Jagielski */
1648*b1cdbd2cSJim Jagielski sal_Bool SAL_CALL rtl_convertStringToUString(
1649*b1cdbd2cSJim Jagielski     rtl_uString ** target, char const * source, sal_Int32 length,
1650*b1cdbd2cSJim Jagielski     rtl_TextEncoding encoding, sal_uInt32 flags) SAL_THROW_EXTERN_C();
1651*b1cdbd2cSJim Jagielski 
1652*b1cdbd2cSJim Jagielski #ifdef __cplusplus
1653*b1cdbd2cSJim Jagielski }
1654*b1cdbd2cSJim Jagielski #endif
1655*b1cdbd2cSJim Jagielski 
1656*b1cdbd2cSJim Jagielski #endif /* _RTL_USTRING_H_ */
1657