Tahoma -> DejaVu Sans for reproducible tests
[LibreOffice.git] / sal / rtl / string.cxx
blob23196e52868230f096663a44e576b0fd6fa63c51
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
22 #include <cassert>
23 #include <cstdlib>
25 #include <osl/interlck.h>
26 #include <osl/diagnose.h>
27 #include <rtl/tencinfo.h>
29 #include "strimp.hxx"
30 #include <rtl/character.hxx>
31 #include <rtl/string.h>
33 #include <rtl/math.h>
35 #if defined _WIN32
36 // Temporary check to verify that the #pragma pack around rtl_String is indeed cargo cult and can
37 // safely be removed:
38 static_assert(alignof (rtl_String) == 4);
39 static_assert(sizeof (rtl_String) == 12);
40 #endif
42 /* ======================================================================= */
44 #if USE_SDT_PROBES
45 #define RTL_LOG_STRING_BITS 8
46 #endif
48 #include "strtmpl.hxx"
50 /* ======================================================================= */
52 sal_Int32 SAL_CALL rtl_str_valueOfFloat(char * pStr, float f)
53 SAL_THROW_EXTERN_C()
55 return rtl::str::valueOfFP<RTL_STR_MAX_VALUEOFFLOAT>(pStr, f);
58 sal_Int32 SAL_CALL rtl_str_valueOfDouble(char * pStr, double d)
59 SAL_THROW_EXTERN_C()
61 return rtl::str::valueOfFP<RTL_STR_MAX_VALUEOFDOUBLE>(pStr, d);
64 float SAL_CALL rtl_str_toFloat(char const * pStr) SAL_THROW_EXTERN_C()
66 assert(pStr);
67 return static_cast<float>(rtl_math_stringToDouble(pStr, pStr + rtl_str_getLength(pStr),
68 '.', 0, nullptr, nullptr));
71 double SAL_CALL rtl_str_toDouble(char const * pStr) SAL_THROW_EXTERN_C()
73 assert(pStr);
74 return rtl_math_stringToDouble(pStr, pStr + rtl_str_getLength(pStr), '.', 0,
75 nullptr, nullptr);
78 /* ======================================================================= */
80 static int rtl_ImplGetFastUTF8ByteLen( const sal_Unicode* pStr, sal_Int32 nLen )
82 int n;
83 sal_Unicode c;
84 sal_uInt32 nUCS4Char;
85 const sal_Unicode* pEndStr;
87 n = 0;
88 pEndStr = pStr+nLen;
89 while ( pStr < pEndStr )
91 c = *pStr;
93 if ( c < 0x80 )
94 n++;
95 else if ( c < 0x800 )
96 n += 2;
97 else
99 if ( !rtl::isHighSurrogate(c) )
100 n += 3;
101 else
103 nUCS4Char = c;
105 if ( pStr+1 < pEndStr )
107 c = *(pStr+1);
108 if ( rtl::isLowSurrogate(c) )
110 nUCS4Char = rtl::combineSurrogates(nUCS4Char, c);
111 pStr++;
115 if ( nUCS4Char < 0x10000 )
116 n += 3;
117 else if ( nUCS4Char < 0x200000 )
118 n += 4;
119 else if ( nUCS4Char < 0x4000000 )
120 n += 5;
121 else
122 n += 6;
126 pStr++;
129 return n;
132 /* ----------------------------------------------------------------------- */
134 static bool rtl_impl_convertUStringToString(rtl_String ** pTarget,
135 sal_Unicode const * pSource,
136 sal_Int32 nLength,
137 rtl_TextEncoding nEncoding,
138 sal_uInt32 nFlags,
139 bool bCheckErrors)
141 assert(pTarget != nullptr);
142 assert(pSource != nullptr || nLength == 0);
143 assert(nLength >= 0);
144 OSL_ASSERT(nLength == 0 || rtl_isOctetTextEncoding(nEncoding));
146 if ( !nLength )
147 rtl_string_new( pTarget );
148 else
150 rtl_String* pTemp;
151 rtl_UnicodeToTextConverter hConverter;
152 sal_uInt32 nInfo;
153 sal_Size nSrcChars;
154 sal_Size nDestBytes;
155 sal_Size nNewLen;
156 sal_Size nNotConvertedChars;
157 sal_Size nMaxCharLen;
159 /* Optimization for UTF-8 - we try to calculate the exact length */
160 /* For all other encoding we try a good estimation */
161 if ( nEncoding == RTL_TEXTENCODING_UTF8 )
163 nNewLen = rtl_ImplGetFastUTF8ByteLen( pSource, nLength );
164 /* Includes the string only ASCII, then we could copy
165 the buffer faster */
166 if ( nNewLen == static_cast<sal_Size>(nLength) )
168 char* pBuffer;
169 if ( *pTarget )
170 rtl_string_release( *pTarget );
171 *pTarget = rtl_string_ImplAlloc( nLength );
172 OSL_ASSERT(*pTarget != nullptr);
173 pBuffer = (*pTarget)->buffer;
176 /* Check ASCII range */
177 OSL_ENSURE( *pSource <= 127,
178 "rtl_uString2String() - UTF8 test is encoding is wrong" );
180 *pBuffer = static_cast<char>(static_cast<unsigned char>(*pSource));
181 pBuffer++;
182 pSource++;
183 nLength--;
185 while ( nLength );
186 return true;
189 nMaxCharLen = 4;
191 else
193 rtl_TextEncodingInfo aTextEncInfo;
194 aTextEncInfo.StructSize = sizeof( aTextEncInfo );
195 if ( !rtl_getTextEncodingInfo( nEncoding, &aTextEncInfo ) )
197 aTextEncInfo.AverageCharSize = 1;
198 aTextEncInfo.MaximumCharSize = 8;
201 nNewLen = nLength * static_cast<sal_Size>(aTextEncInfo.AverageCharSize);
202 nMaxCharLen = aTextEncInfo.MaximumCharSize;
205 nFlags |= RTL_UNICODETOTEXT_FLAGS_FLUSH;
206 hConverter = rtl_createUnicodeToTextConverter( nEncoding );
208 for (;;)
210 pTemp = rtl_string_ImplAlloc( nNewLen );
211 OSL_ASSERT(pTemp != nullptr);
212 nDestBytes = rtl_convertUnicodeToText( hConverter, nullptr,
213 pSource, nLength,
214 pTemp->buffer, nNewLen,
215 nFlags,
216 &nInfo, &nSrcChars );
217 if (bCheckErrors && (nInfo & RTL_UNICODETOTEXT_INFO_ERROR) != 0)
219 rtl_freeString(pTemp);
220 rtl_destroyUnicodeToTextConverter(hConverter);
221 return false;
224 if ((nInfo & RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL) == 0)
225 break;
227 /* Buffer not big enough, try again with enough space */
228 rtl_freeString( pTemp );
230 /* Try with the max. count of characters with
231 additional overhead for replacing functionality */
232 nNotConvertedChars = nLength-nSrcChars;
233 nNewLen = nDestBytes+(nNotConvertedChars*nMaxCharLen)+nNotConvertedChars+4;
236 /* Set the buffer to the correct size or is there to
237 much overhead, reallocate to the correct size */
238 if ( nNewLen > nDestBytes+8 )
240 rtl_String* pTemp2 = rtl_string_ImplAlloc( nDestBytes );
241 OSL_ASSERT(pTemp2 != nullptr);
242 rtl::str::Copy(pTemp2->buffer, pTemp->buffer, nDestBytes);
243 rtl_freeString( pTemp );
244 pTemp = pTemp2;
246 else
248 pTemp->length = nDestBytes;
249 pTemp->buffer[nDestBytes] = 0;
252 rtl_destroyUnicodeToTextConverter( hConverter );
253 if ( *pTarget )
254 rtl_string_release( *pTarget );
255 *pTarget = pTemp;
257 /* Results the conversion in an empty buffer -
258 create an empty string */
259 if ( pTemp && !nDestBytes )
260 rtl_string_new( pTarget );
262 return true;
265 void SAL_CALL rtl_uString2String( rtl_String** ppThis,
266 const sal_Unicode* pUStr,
267 sal_Int32 nULen,
268 rtl_TextEncoding eTextEncoding,
269 sal_uInt32 nCvtFlags )
270 SAL_THROW_EXTERN_C()
272 rtl_impl_convertUStringToString(ppThis, pUStr, nULen, eTextEncoding,
273 nCvtFlags, false);
276 sal_Bool SAL_CALL rtl_convertUStringToString(rtl_String ** pTarget,
277 sal_Unicode const * pSource,
278 sal_Int32 nLength,
279 rtl_TextEncoding nEncoding,
280 sal_uInt32 nFlags)
281 SAL_THROW_EXTERN_C()
283 return rtl_impl_convertUStringToString(pTarget, pSource, nLength, nEncoding,
284 nFlags, true);
287 void rtl_string_newReplaceFirst(
288 rtl_String ** newStr, rtl_String * str, char const * from,
289 sal_Int32 fromLength, char const * to, sal_Int32 toLength,
290 sal_Int32 * index) SAL_THROW_EXTERN_C()
292 assert(str != nullptr);
293 assert(index != nullptr);
294 assert(*index >= 0 && *index <= str->length);
295 assert(fromLength >= 0);
296 assert(toLength >= 0);
297 sal_Int32 i = rtl_str_indexOfStr_WithLength(
298 str->buffer + *index, str->length - *index, from, fromLength);
299 if (i == -1) {
300 rtl_string_assign(newStr, str);
301 } else {
302 assert(i <= str->length - *index);
303 i += *index;
304 assert(fromLength <= str->length);
305 if (str->length - fromLength > SAL_MAX_INT32 - toLength) {
306 std::abort();
308 rtl::str::newReplaceStrAt(newStr, str, i, fromLength, to, toLength);
310 *index = i;
313 void rtl_string_newReplaceAll(
314 rtl_String ** newStr, rtl_String * str, char const * from,
315 sal_Int32 fromLength, char const * to, sal_Int32 toLength)
316 SAL_THROW_EXTERN_C()
318 rtl::str::newReplaceAllFromIndex(newStr, str, from, fromLength, to, toLength, 0);
321 sal_Int32 SAL_CALL rtl_str_getLength(const char* pStr) SAL_THROW_EXTERN_C()
323 return rtl::str::getLength(pStr);
326 sal_Int32 SAL_CALL rtl_str_compare(const char* pStr1, const char* pStr2) SAL_THROW_EXTERN_C()
328 return rtl::str::compare(rtl::str::null_terminated(pStr1), rtl::str::null_terminated(pStr2),
329 rtl::str::CompareNormal(), rtl::str::noShortening);
332 sal_Int32 SAL_CALL rtl_str_compare_WithLength(const char* pStr1, sal_Int32 nStr1Len,
333 const char* pStr2, sal_Int32 nStr2Len)
334 SAL_THROW_EXTERN_C()
336 return rtl::str::compare(rtl::str::with_length(pStr1, nStr1Len),
337 rtl::str::with_length(pStr2, nStr2Len),
338 rtl::str::CompareNormal(), rtl::str::noShortening);
341 sal_Int32 SAL_CALL rtl_str_shortenedCompare_WithLength(const char* pStr1, sal_Int32 nStr1Len,
342 const char* pStr2, sal_Int32 nStr2Len,
343 sal_Int32 nShortenedLength)
344 SAL_THROW_EXTERN_C()
346 return rtl::str::compare(rtl::str::with_length(pStr1, nStr1Len),
347 rtl::str::with_length(pStr2, nStr2Len),
348 rtl::str::CompareNormal(), nShortenedLength);
351 sal_Int32 SAL_CALL rtl_str_reverseCompare_WithLength(const char* pStr1, sal_Int32 nStr1Len,
352 const char* pStr2, sal_Int32 nStr2Len)
353 SAL_THROW_EXTERN_C()
355 return rtl::str::reverseCompare_WithLengths(pStr1, nStr1Len, pStr2, nStr2Len,
356 rtl::str::CompareNormal());
359 sal_Int32 SAL_CALL rtl_str_compareIgnoreAsciiCase(const char* pStr1, const char* pStr2)
360 SAL_THROW_EXTERN_C()
362 return rtl::str::compare(rtl::str::null_terminated(pStr1), rtl::str::null_terminated(pStr2),
363 rtl::str::CompareIgnoreAsciiCase(), rtl::str::noShortening);
366 sal_Int32 SAL_CALL rtl_str_compareIgnoreAsciiCase_WithLength(const char* pStr1, sal_Int32 nStr1Len,
367 const char* pStr2, sal_Int32 nStr2Len)
368 SAL_THROW_EXTERN_C()
370 return rtl::str::compare(rtl::str::with_length(pStr1, nStr1Len),
371 rtl::str::with_length(pStr2, nStr2Len),
372 rtl::str::CompareIgnoreAsciiCase(), rtl::str::noShortening);
375 sal_Int32 SAL_CALL rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
376 const char* pStr1, sal_Int32 nStr1Len, const char* pStr2, sal_Int32 nStr2Len,
377 sal_Int32 nShortenedLength) SAL_THROW_EXTERN_C()
379 return rtl::str::compare(rtl::str::with_length(pStr1, nStr1Len),
380 rtl::str::with_length(pStr2, nStr2Len),
381 rtl::str::CompareIgnoreAsciiCase(), nShortenedLength);
384 sal_Int32 SAL_CALL rtl_str_hashCode(const char* pStr) SAL_THROW_EXTERN_C()
386 return rtl::str::hashCode(pStr);
389 sal_Int32 SAL_CALL rtl_str_hashCode_WithLength(const char* pStr, sal_Int32 nLen)
390 SAL_THROW_EXTERN_C()
392 return rtl::str::hashCode_WithLength(pStr, nLen);
395 sal_Int32 SAL_CALL rtl_str_indexOfChar(const char* pStr, char c) SAL_THROW_EXTERN_C()
397 return rtl::str::indexOfChar(pStr, c);
400 sal_Int32 SAL_CALL rtl_str_indexOfChar_WithLength(const char* pStr, sal_Int32 nLen, char c)
401 SAL_THROW_EXTERN_C()
403 return rtl::str::indexOfChar_WithLength(pStr, nLen, c);
406 sal_Int32 SAL_CALL rtl_str_lastIndexOfChar(const char* pStr, char c) SAL_THROW_EXTERN_C()
408 return rtl::str::lastIndexOfChar(pStr, c);
411 sal_Int32 SAL_CALL rtl_str_lastIndexOfChar_WithLength(const char* pStr, sal_Int32 nLen, char c)
412 SAL_THROW_EXTERN_C()
414 return rtl::str::lastIndexOfChar_WithLength(pStr, nLen, c);
417 sal_Int32 SAL_CALL rtl_str_indexOfStr(const char* pStr, const char* pSubStr) SAL_THROW_EXTERN_C()
419 return rtl::str::indexOfStr(pStr, pSubStr);
422 sal_Int32 SAL_CALL rtl_str_indexOfStr_WithLength(const char* pStr, sal_Int32 nStrLen,
423 const char* pSubStr, sal_Int32 nSubLen)
424 SAL_THROW_EXTERN_C()
426 return rtl::str::indexOfStr_WithLength(pStr, nStrLen, pSubStr, nSubLen);
429 sal_Int32 SAL_CALL rtl_str_lastIndexOfStr(const char* pStr, const char* pSubStr)
430 SAL_THROW_EXTERN_C()
432 return rtl::str::lastIndexOfStr(pStr, pSubStr);
435 sal_Int32 SAL_CALL rtl_str_lastIndexOfStr_WithLength(const char* pStr, sal_Int32 nStrLen,
436 const char* pSubStr, sal_Int32 nSubLen)
437 SAL_THROW_EXTERN_C()
439 return rtl::str::lastIndexOfStr_WithLength(pStr, nStrLen, pSubStr, nSubLen);
442 void SAL_CALL rtl_str_replaceChar(char* pStr, char cOld, char cNew) SAL_THROW_EXTERN_C()
444 return rtl::str::replaceChars(rtl::str::null_terminated(pStr), rtl::str::FromTo(cOld, cNew));
447 void SAL_CALL rtl_str_replaceChar_WithLength(char* pStr, sal_Int32 nLen, char cOld, char cNew)
448 SAL_THROW_EXTERN_C()
450 return rtl::str::replaceChars(rtl::str::with_length(pStr, nLen), rtl::str::FromTo(cOld, cNew));
453 void SAL_CALL rtl_str_toAsciiLowerCase(char* pStr) SAL_THROW_EXTERN_C()
455 return rtl::str::replaceChars(rtl::str::null_terminated(pStr), rtl::str::toAsciiLower);
458 void SAL_CALL rtl_str_toAsciiLowerCase_WithLength(char* pStr, sal_Int32 nLen) SAL_THROW_EXTERN_C()
460 return rtl::str::replaceChars(rtl::str::with_length(pStr, nLen), rtl::str::toAsciiLower);
463 void SAL_CALL rtl_str_toAsciiUpperCase(char* pStr) SAL_THROW_EXTERN_C()
465 return rtl::str::replaceChars(rtl::str::null_terminated(pStr), rtl::str::toAsciiUpper);
468 void SAL_CALL rtl_str_toAsciiUpperCase_WithLength(char* pStr, sal_Int32 nLen) SAL_THROW_EXTERN_C()
470 return rtl::str::replaceChars(rtl::str::with_length(pStr, nLen), rtl::str::toAsciiUpper);
473 sal_Int32 SAL_CALL rtl_str_trim(char* pStr) SAL_THROW_EXTERN_C() { return rtl::str::trim(pStr); }
475 sal_Int32 SAL_CALL rtl_str_trim_WithLength(char* pStr, sal_Int32 nLen) SAL_THROW_EXTERN_C()
477 return rtl::str::trim_WithLength(pStr, nLen);
480 sal_Int32 SAL_CALL rtl_str_valueOfBoolean(char* pStr, sal_Bool b) SAL_THROW_EXTERN_C()
482 return rtl::str::valueOfBoolean(pStr, b);
485 sal_Int32 SAL_CALL rtl_str_valueOfChar(char* pStr, char c) SAL_THROW_EXTERN_C()
487 return rtl::str::valueOfChar(pStr, c);
490 sal_Int32 SAL_CALL rtl_str_valueOfInt32(char* pStr, sal_Int32 n, sal_Int16 nRadix)
491 SAL_THROW_EXTERN_C()
493 return rtl::str::valueOfInt<RTL_STR_MAX_VALUEOFINT32>(pStr, n, nRadix);
496 sal_Int32 SAL_CALL rtl_str_valueOfInt64(char* pStr, sal_Int64 n, sal_Int16 nRadix)
497 SAL_THROW_EXTERN_C()
499 return rtl::str::valueOfInt<RTL_STR_MAX_VALUEOFINT64>(pStr, n, nRadix);
502 sal_Int32 SAL_CALL rtl_str_valueOfUInt64(char* pStr, sal_uInt64 n, sal_Int16 nRadix)
503 SAL_THROW_EXTERN_C()
505 return rtl::str::valueOfInt<RTL_STR_MAX_VALUEOFUINT64>(pStr, n, nRadix);
508 sal_Bool SAL_CALL rtl_str_toBoolean(const char* pStr) SAL_THROW_EXTERN_C()
510 return rtl::str::toBoolean(pStr);
513 sal_Int32 SAL_CALL rtl_str_toInt32(const char* pStr, sal_Int16 nRadix) SAL_THROW_EXTERN_C()
515 return rtl::str::toInt<sal_Int32>(rtl::str::null_terminated(pStr), nRadix);
518 sal_Int64 SAL_CALL rtl_str_toInt64(const char* pStr, sal_Int16 nRadix) SAL_THROW_EXTERN_C()
520 return rtl::str::toInt<sal_Int64>(rtl::str::null_terminated(pStr), nRadix);
523 sal_Int64 SAL_CALL rtl_str_toInt64_WithLength(const char* pStr, sal_Int16 nRadix,
524 sal_Int32 nStrLength) SAL_THROW_EXTERN_C()
526 return rtl::str::toInt<sal_Int64>(rtl::str::with_length(pStr, nStrLength), nRadix);
529 sal_uInt32 SAL_CALL rtl_str_toUInt32(const char* pStr, sal_Int16 nRadix) SAL_THROW_EXTERN_C()
531 return rtl::str::toInt<sal_uInt32>(rtl::str::null_terminated(pStr), nRadix);
534 sal_uInt64 SAL_CALL rtl_str_toUInt64(const char* pStr, sal_Int16 nRadix) SAL_THROW_EXTERN_C()
536 return rtl::str::toInt<sal_uInt64>(rtl::str::null_terminated(pStr), nRadix);
539 rtl_String* rtl_string_ImplAlloc(sal_Int32 nLen) { return rtl::str::Alloc<rtl_String>(nLen); }
541 void SAL_CALL rtl_string_acquire(rtl_String* pThis) SAL_THROW_EXTERN_C()
543 return rtl::str::acquire(pThis);
546 void SAL_CALL rtl_string_release(rtl_String* pThis) SAL_THROW_EXTERN_C()
548 return rtl::str::release(pThis);
551 void SAL_CALL rtl_string_new(rtl_String** ppThis) SAL_THROW_EXTERN_C()
553 return rtl::str::new_(ppThis);
556 rtl_String* SAL_CALL rtl_string_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C()
558 assert(nLen >= 0);
559 return rtl::str::Alloc<rtl_String>(nLen);
562 void SAL_CALL rtl_string_new_WithLength(rtl_String** ppThis, sal_Int32 nLen) SAL_THROW_EXTERN_C()
564 rtl::str::new_WithLength(ppThis, nLen);
567 void SAL_CALL rtl_string_newFromString(rtl_String** ppThis, const rtl_String* pStr)
568 SAL_THROW_EXTERN_C()
570 rtl::str::newFromString(ppThis, pStr);
573 void SAL_CALL rtl_string_newFromStr(rtl_String** ppThis, const char* pCharStr) SAL_THROW_EXTERN_C()
575 rtl::str::newFromStr(ppThis, pCharStr);
578 void SAL_CALL rtl_string_newFromStr_WithLength(rtl_String** ppThis, const char* pCharStr,
579 sal_Int32 nLen) SAL_THROW_EXTERN_C()
581 rtl::str::newFromStr_WithLength(ppThis, pCharStr, nLen);
584 void SAL_CALL rtl_string_newFromSubString(rtl_String** ppThis, const rtl_String* pFrom,
585 sal_Int32 beginIndex, sal_Int32 count)
586 SAL_THROW_EXTERN_C()
588 rtl::str::newFromSubString(ppThis, pFrom, beginIndex, count);
591 // Used when creating from string literals.
592 void SAL_CALL rtl_string_newFromLiteral(rtl_String** ppThis, const char* pCharStr, sal_Int32 nLen,
593 sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
595 rtl::str::newFromStr_WithLength(ppThis, pCharStr, nLen, allocExtra);
598 void SAL_CALL rtl_string_assign(rtl_String** ppThis, rtl_String* pStr) SAL_THROW_EXTERN_C()
600 rtl::str::assign(ppThis, pStr);
603 sal_Int32 SAL_CALL rtl_string_getLength(const rtl_String* pThis) SAL_THROW_EXTERN_C()
605 return rtl::str::getLength(pThis);
608 char* SAL_CALL rtl_string_getStr(rtl_String* pThis) SAL_THROW_EXTERN_C()
610 return rtl::str::getStr(pThis);
613 void SAL_CALL rtl_string_newConcat(rtl_String** ppThis, rtl_String* pLeft, rtl_String* pRight)
614 SAL_THROW_EXTERN_C()
616 rtl::str::newConcat(ppThis, pLeft, pRight);
619 void SAL_CALL rtl_string_ensureCapacity(rtl_String** ppThis, sal_Int32 size) SAL_THROW_EXTERN_C()
621 rtl::str::ensureCapacity(ppThis, size);
624 void SAL_CALL rtl_string_newReplaceStrAt(rtl_String** ppThis, rtl_String* pStr, sal_Int32 nIndex,
625 sal_Int32 nCount, rtl_String* pNewSubStr)
626 SAL_THROW_EXTERN_C()
628 rtl::str::newReplaceStrAt(ppThis, pStr, nIndex, nCount, pNewSubStr);
631 void SAL_CALL rtl_string_newReplaceStrAt_WithLength(rtl_String** ppThis, rtl_String* pStr, sal_Int32 nIndex,
632 sal_Int32 nCount, char const * subStr, sal_Int32 substrLen)
633 SAL_THROW_EXTERN_C()
635 rtl::str::newReplaceStrAt(ppThis, pStr, nIndex, nCount, subStr, substrLen);
638 void SAL_CALL rtl_string_newReplace(rtl_String** ppThis, rtl_String* pStr, char cOld, char cNew)
639 SAL_THROW_EXTERN_C()
641 rtl::str::newReplace(ppThis, pStr, cOld, cNew);
644 void SAL_CALL rtl_string_newToAsciiLowerCase(rtl_String** ppThis, rtl_String* pStr)
645 SAL_THROW_EXTERN_C()
647 rtl::str::newReplaceChars<rtl::str::ToAsciiLower>(ppThis, pStr);
650 void SAL_CALL rtl_string_newToAsciiUpperCase(rtl_String** ppThis, rtl_String* pStr)
651 SAL_THROW_EXTERN_C()
653 rtl::str::newReplaceChars<rtl::str::ToAsciiUpper>(ppThis, pStr);
656 void SAL_CALL rtl_string_newTrim(rtl_String** ppThis, rtl_String* pStr) SAL_THROW_EXTERN_C()
658 rtl::str::newTrim(ppThis, pStr);
661 sal_Int32 SAL_CALL rtl_string_getToken(rtl_String** ppThis, rtl_String* pStr, sal_Int32 nToken,
662 char cTok, sal_Int32 nIndex) SAL_THROW_EXTERN_C()
664 return rtl::str::getToken(ppThis, pStr, nToken, cTok, nIndex);
667 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */