LibreOffice
LibreOffice 6.4 SDK C/C++ API Reference
ustring.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_RTL_USTRING_H
21 #define INCLUDED_RTL_USTRING_H
22 
23 #include "sal/config.h"
24 
25 #include "osl/interlck.h"
26 #include "rtl/string.h"
27 #include "rtl/textenc.h"
28 #include "sal/saldllapi.h"
29 #include "sal/types.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /* ======================================================================= */
36 
49 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_getLength(
50  const sal_Unicode * str ) SAL_THROW_EXTERN_C();
51 
70 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_compare(
71  const sal_Unicode * first, const sal_Unicode * second ) SAL_THROW_EXTERN_C();
72 
99  const sal_Unicode * first, sal_Int32 firstLen, const sal_Unicode * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
100 
131  const sal_Unicode * first, sal_Int32 firstLen, const sal_Unicode * second, sal_Int32 secondLen, sal_Int32 shortenedLen ) SAL_THROW_EXTERN_C();
132 
159  const sal_Unicode * first, sal_Int32 firstLen, const sal_Unicode * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
160 
183  const sal_Unicode * first, const sal_Char * second, sal_Int32 len ) SAL_THROW_EXTERN_C();
184 
205  const sal_Unicode * first, const sal_Unicode * second ) SAL_THROW_EXTERN_C();
206 
235  const sal_Unicode * first, sal_Int32 firstLen, const sal_Unicode * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
236 
270  const sal_Unicode * first, sal_Int32 firstLen, const sal_Unicode * second, sal_Int32 secondLen, sal_Int32 shortenedLen ) SAL_THROW_EXTERN_C();
271 
296  const sal_Unicode * first, const sal_Char * second ) SAL_THROW_EXTERN_C();
297 
325  const sal_Unicode * first, sal_Int32 firstLen, const sal_Char * second ) SAL_THROW_EXTERN_C();
326 
358  const sal_Unicode * first, sal_Int32 firstLen, const sal_Char * second, sal_Int32 shortenedLen ) SAL_THROW_EXTERN_C();
359 
390  const sal_Unicode * first, sal_Int32 firstLen, const sal_Char * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
391 
417  const sal_Unicode * first, const sal_Char * second ) SAL_THROW_EXTERN_C();
418 
448  const sal_Unicode * first, sal_Int32 firstLen, const sal_Char * second ) SAL_THROW_EXTERN_C();
449 
482  sal_Unicode const * first, sal_Int32 firstLen,
483  char const * second, sal_Int32 secondLen) SAL_THROW_EXTERN_C();
484 
519  const sal_Unicode * first, sal_Int32 firstLen, const sal_Char * second, sal_Int32 shortenedLen ) SAL_THROW_EXTERN_C();
520 
533 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_hashCode(
534  const sal_Unicode * str ) SAL_THROW_EXTERN_C();
535 
552  const sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
553 
569  const sal_Unicode * str, sal_Unicode ch ) SAL_THROW_EXTERN_C();
570 
588  const sal_Unicode * str, sal_Int32 len, sal_Unicode ch ) SAL_THROW_EXTERN_C();
589 
606  const sal_Unicode * str, sal_Unicode ch ) SAL_THROW_EXTERN_C();
607 
626  const sal_Unicode * str, sal_Int32 len, sal_Unicode ch ) SAL_THROW_EXTERN_C();
627 
644  const sal_Unicode * str, const sal_Unicode * subStr ) SAL_THROW_EXTERN_C();
645 
669  const sal_Unicode * str, sal_Int32 len, const sal_Unicode * subStr, sal_Int32 subLen ) SAL_THROW_EXTERN_C();
670 
696  sal_Unicode const * str, sal_Int32 len,
697  char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C();
698 
715  const sal_Unicode * str, const sal_Unicode * subStr ) SAL_THROW_EXTERN_C();
716 
740  const sal_Unicode * str, sal_Int32 len, const sal_Unicode * subStr, sal_Int32 subLen ) SAL_THROW_EXTERN_C();
741 
767  sal_Unicode const * str, sal_Int32 len,
768  char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C();
769 
785  sal_Unicode * str, sal_Unicode oldChar, sal_Unicode newChar ) SAL_THROW_EXTERN_C();
786 
805  sal_Unicode * str, sal_Int32 len, sal_Unicode oldChar, sal_Unicode newChar ) SAL_THROW_EXTERN_C();
806 
818 
832  sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
833 
845 
859  sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
860 
873 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_trim(
875 
893  sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
894 
915 #define RTL_USTR_MAX_VALUEOFBOOLEAN RTL_STR_MAX_VALUEOFBOOLEAN
916 
932 #define RTL_USTR_MAX_VALUEOFCHAR RTL_STR_MAX_VALUEOFCHAR
933 
954  sal_Unicode * str, sal_Int32 i, sal_Int16 radix ) SAL_THROW_EXTERN_C();
955 #define RTL_USTR_MIN_RADIX RTL_STR_MIN_RADIX
956 #define RTL_USTR_MAX_RADIX RTL_STR_MAX_RADIX
957 #define RTL_USTR_MAX_VALUEOFINT32 RTL_STR_MAX_VALUEOFINT32
958 
979  sal_Unicode * str, sal_Int64 l, sal_Int16 radix ) SAL_THROW_EXTERN_C();
980 #define RTL_USTR_MAX_VALUEOFINT64 RTL_STR_MAX_VALUEOFINT64
981 
1002  sal_Unicode * str, sal_uInt64 l, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1003 #define RTL_USTR_MAX_VALUEOFUINT64 RTL_STR_MAX_VALUEOFUINT64
1021  sal_Unicode * str, float f ) SAL_THROW_EXTERN_C();
1022 #define RTL_USTR_MAX_VALUEOFFLOAT RTL_STR_MAX_VALUEOFFLOAT
1040  sal_Unicode * str, double d ) SAL_THROW_EXTERN_C();
1041 #define RTL_USTR_MAX_VALUEOFDOUBLE RTL_STR_MAX_VALUEOFDOUBLE
1055  const sal_Unicode * str ) SAL_THROW_EXTERN_C();
1056 
1073 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_toInt32(
1074  const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1075 
1094 SAL_DLLPUBLIC sal_uInt32 SAL_CALL rtl_ustr_toUInt32(
1095  const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1096 
1113 SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_ustr_toInt64(
1114  const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1115 
1139  const sal_Unicode * str, sal_Int16 radix, sal_Int32 nStrLength ) SAL_THROW_EXTERN_C();
1140 
1159 SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_ustr_toUInt64(
1160  const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1161 
1175  const sal_Unicode * str ) SAL_THROW_EXTERN_C();
1176 
1190  const sal_Unicode * str ) SAL_THROW_EXTERN_C();
1191 
1192 /* ======================================================================= */
1193 
1194 #if defined(_WIN32)
1195 #pragma pack(push, 4)
1196 #endif
1197 
1201 typedef struct SAL_DLLPUBLIC_RTTI _rtl_uString
1202 {
1203  oslInterlockedCount refCount; /* opaque */
1204  sal_Int32 length;
1205  sal_Unicode buffer[1];
1206 } rtl_uString;
1209 #if defined(_WIN32)
1210 #pragma pack(pop)
1211 #endif
1212 
1213 /* ----------------------------------------------------------------------- */
1214 
1221  rtl_uString * str ) SAL_THROW_EXTERN_C() SAL_HOT;
1222 
1231  rtl_uString * str ) SAL_THROW_EXTERN_C() SAL_HOT;
1232 
1240  rtl_uString ** newStr ) SAL_THROW_EXTERN_C();
1241 
1264 SAL_DLLPUBLIC rtl_uString * SAL_CALL rtl_uString_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C();
1265 
1280  rtl_uString ** newStr, sal_Int32 nLen ) SAL_THROW_EXTERN_C();
1281 
1296  rtl_uString ** newStr, const rtl_uString * value ) SAL_THROW_EXTERN_C();
1297 
1312  rtl_uString ** newStr, const sal_Unicode * value ) SAL_THROW_EXTERN_C();
1313 
1332  rtl_uString ** newStr, const sal_Unicode * value, sal_Int32 len ) SAL_THROW_EXTERN_C();
1333 
1350  rtl_uString ** newStr, const rtl_uString * from,
1351  sal_Int32 beginIndex, sal_Int32 count ) SAL_THROW_EXTERN_C();
1352 
1371  rtl_uString ** newStr, const sal_Char * value ) SAL_THROW_EXTERN_C();
1372 
1378  rtl_uString ** newStr, const sal_Char * value, sal_Int32 len,
1379  sal_Int32 allocExtra ) SAL_THROW_EXTERN_C();
1380 
1401  rtl_uString ** newString, sal_uInt32 const * codePoints,
1402  sal_Int32 codePointCount) SAL_THROW_EXTERN_C();
1403 
1417  rtl_uString ** str, rtl_uString * rightValue ) SAL_THROW_EXTERN_C();
1418 
1430  const rtl_uString * str ) SAL_THROW_EXTERN_C();
1431 
1441  rtl_uString * str ) SAL_THROW_EXTERN_C();
1442 
1461  rtl_uString ** newStr, rtl_uString * left, rtl_uString * right ) SAL_THROW_EXTERN_C();
1462 
1484  rtl_uString ** newString, rtl_uString * left, char const * right,
1485  sal_Int32 rightLength);
1486 
1506  rtl_uString ** newString, rtl_uString * left, sal_Unicode const * right,
1507  sal_Int32 rightLength);
1508 
1539  rtl_uString ** newStr, rtl_uString * str, sal_Int32 idx, sal_Int32 count, rtl_uString * subStr ) SAL_THROW_EXTERN_C();
1540 
1566  rtl_uString ** newStr, rtl_uString * str, sal_Unicode oldChar, sal_Unicode newChar ) SAL_THROW_EXTERN_C();
1567 
1590  rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
1591  rtl_uString const * to, sal_Int32 * index) SAL_THROW_EXTERN_C();
1592 
1618  rtl_uString ** newStr, rtl_uString * str, char const * from,
1619  sal_Int32 fromLength, rtl_uString const * to, sal_Int32 * index)
1621 
1647  rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
1648  char const * to, sal_Int32 toLength, sal_Int32 * index)
1650 
1679  rtl_uString ** newStr, rtl_uString * str, char const * from,
1680  sal_Int32 fromLength, char const * to, sal_Int32 toLength,
1681  sal_Int32 * index) SAL_THROW_EXTERN_C();
1682 
1715  rtl_uString ** newStr, rtl_uString * str, char const * from,
1716  sal_Int32 fromLength, sal_Unicode const * to, sal_Int32 toLength,
1717  sal_Int32 * index) SAL_THROW_EXTERN_C();
1718 
1751  rtl_uString ** newStr, rtl_uString * str, sal_Unicode const * from,
1752  sal_Int32 fromLength, char const * to, sal_Int32 toLength,
1753  sal_Int32 * index) SAL_THROW_EXTERN_C();
1754 
1787  rtl_uString ** newStr, rtl_uString * str, sal_Unicode const * from,
1788  sal_Int32 fromLength, sal_Unicode const * to, sal_Int32 toLength,
1789  sal_Int32 * index) SAL_THROW_EXTERN_C();
1790 
1809  rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
1810  rtl_uString const * to) SAL_THROW_EXTERN_C();
1811 
1832  rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
1833  rtl_uString const * to, sal_Int32 fromIndex) SAL_THROW_EXTERN_C();
1834 
1856  rtl_uString ** newStr, rtl_uString * str, char const * from,
1857  sal_Int32 fromLength, rtl_uString const * to) SAL_THROW_EXTERN_C();
1858 
1880  rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
1881  char const * to, sal_Int32 toLength) SAL_THROW_EXTERN_C();
1882 
1907  rtl_uString ** newStr, rtl_uString * str, char const * from,
1908  sal_Int32 fromLength, char const * to, sal_Int32 toLength)
1910 
1938  rtl_uString ** newStr, rtl_uString * str, char const * from,
1939  sal_Int32 fromLength, sal_Unicode const * to, sal_Int32 toLength)
1941 
1969  rtl_uString ** newStr, rtl_uString * str, sal_Unicode const * from,
1970  sal_Int32 fromLength, char const * to, sal_Int32 toLength)
1972 
2000  rtl_uString ** newStr, rtl_uString * str, sal_Unicode const * from,
2001  sal_Int32 fromLength, sal_Unicode const * to, sal_Int32 toLength)
2003 
2024  rtl_uString ** newStr, rtl_uString * str ) SAL_THROW_EXTERN_C();
2025 
2046  rtl_uString ** newStr, rtl_uString * str ) SAL_THROW_EXTERN_C();
2047 
2070  rtl_uString ** newStr, rtl_uString * str ) SAL_THROW_EXTERN_C();
2071 
2117  rtl_uString ** newStr , rtl_uString * str, sal_Int32 token, sal_Unicode cTok, sal_Int32 idx ) SAL_THROW_EXTERN_C();
2118 
2119 /* ======================================================================= */
2120 
2134 // The &foo[0] trick is intentional, it makes sure the type is char* or const char*
2135 // (plain cast to const char* would not work with non-const char foo[]="a", which seems to be allowed).
2136 // This is to avoid mistaken use with functions that accept string literals
2137 // (i.e. const char (&)[N]) where usage of this macro otherwise could match
2138 // the argument and a following int argument with a default value (e.g. OUString::match()).
2139 #define RTL_CONSTASCII_USTRINGPARAM( constAsciiStr ) (&(constAsciiStr)[0]), \
2140  ((sal_Int32)(SAL_N_ELEMENTS(constAsciiStr)-1)), RTL_TEXTENCODING_ASCII_US
2141 
2142 /* ======================================================================= */
2143 
2144 /* predefined constants for String-Conversion */
2145 #define OSTRING_TO_OUSTRING_CVTFLAGS (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |\
2146  RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |\
2147  RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT)
2148 
2149 /* ----------------------------------------------------------------------- */
2150 
2184  rtl_uString ** newStr, const sal_Char * str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags ) SAL_THROW_EXTERN_C();
2185 
2186 /* ======================================================================= */
2187 /* Interning methods */
2188 
2209  rtl_uString ** newStr, rtl_uString * str) SAL_THROW_EXTERN_C();
2210 
2247  rtl_uString ** newStr,
2248  const sal_Char * str,
2249  sal_Int32 len,
2250  rtl_TextEncoding encoding,
2251  sal_uInt32 convertFlags,
2252  sal_uInt32 *pInfo) SAL_THROW_EXTERN_C();
2253 
2307  rtl_uString const * string, sal_Int32 * indexUtf16,
2308  sal_Int32 incrementCodePoints);
2309 
2344  rtl_uString ** target, char const * source, sal_Int32 length,
2345  rtl_TextEncoding encoding, sal_uInt32 flags) SAL_THROW_EXTERN_C();
2346 
2363 SAL_DLLPUBLIC void SAL_CALL rtl_uString_ensureCapacity( rtl_uString ** str, sal_Int32 size ) SAL_THROW_EXTERN_C();
2364 
2365 #ifdef __cplusplus
2366 }
2367 #endif
2368 
2369 #endif // INCLUDED_RTL_USTRING_H
2370 
2371 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl_uString_newReplaceAllAsciiLAsciiL
SAL_DLLPUBLIC void rtl_uString_newReplaceAllAsciiLAsciiL(rtl_uString **newStr, rtl_uString *str, char const *from, sal_Int32 fromLength, char const *to, sal_Int32 toLength) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
rtl_uString_newToAsciiUpperCase
SAL_DLLPUBLIC void rtl_uString_newToAsciiUpperCase(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Create a new string by converting all ASCII lowercase letters to uppercase within another string.
rtl_ustr_toUInt64
SAL_DLLPUBLIC sal_uInt64 rtl_ustr_toUInt64(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an unsigned long integer.
rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength
SAL_DLLPUBLIC sal_Int32 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()
Compare two strings with a maximum count of characters, ignoring the case of ASCII characters.
rtl_ustr_valueOfInt64
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfInt64(sal_Unicode *str, sal_Int64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of a long integer.
sal_Char
char sal_Char
A legacy synonym for char.
Definition: types.h:120
rtl_uString_newReplaceAllUtf16LUtf16L
SAL_DLLPUBLIC void rtl_uString_newReplaceAllUtf16LUtf16L(rtl_uString **newStr, rtl_uString *str, sal_Unicode const *from, sal_Int32 fromLength, sal_Unicode const *to, sal_Int32 toLength) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
rtl_convertStringToUString
SAL_DLLPUBLIC sal_Bool rtl_convertStringToUString(rtl_uString **target, char const *source, sal_Int32 length, rtl_TextEncoding encoding, sal_uInt32 flags) SAL_THROW_EXTERN_C()
Converts a byte string to a Unicode string, signalling failure.
rtl_ustr_indexOfChar
SAL_DLLPUBLIC sal_Int32 rtl_ustr_indexOfChar(const sal_Unicode *str, sal_Unicode ch) SAL_THROW_EXTERN_C()
Search for the first occurrence of a character within a string.
rtl_string2UString
SAL_DLLPUBLIC void rtl_string2UString(rtl_uString **newStr, const sal_Char *str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags) SAL_THROW_EXTERN_C()
Create a new Unicode string by converting a byte string, using a specific text encoding.
rtl_ustr_compare
SAL_DLLPUBLIC sal_Int32 rtl_ustr_compare(const sal_Unicode *first, const sal_Unicode *second) SAL_THROW_EXTERN_C()
Compare two strings.
rtl_ustr_trim
SAL_DLLPUBLIC sal_Int32 rtl_ustr_trim(sal_Unicode *str) SAL_THROW_EXTERN_C()
Remove white space from both ends of a string.
rtl_ustr_toAsciiUpperCase
SAL_DLLPUBLIC void rtl_ustr_toAsciiUpperCase(sal_Unicode *str) SAL_THROW_EXTERN_C()
Convert all ASCII lowercase letters to uppercase within a string.
rtl_TextEncoding
sal_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition: textenc.h:33
rtl_uString_newReplaceStrAt
SAL_DLLPUBLIC void rtl_uString_newReplaceStrAt(rtl_uString **newStr, rtl_uString *str, sal_Int32 idx, sal_Int32 count, rtl_uString *subStr) SAL_THROW_EXTERN_C()
Create a new string by replacing a substring of another string.
rtl_uString_newFromStr_WithLength
SAL_DLLPUBLIC void rtl_uString_newFromStr_WithLength(rtl_uString **newStr, const sal_Unicode *value, sal_Int32 len) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
rtl_uString_iterateCodePoints
SAL_DLLPUBLIC sal_uInt32 rtl_uString_iterateCodePoints(rtl_uString const *string, sal_Int32 *indexUtf16, sal_Int32 incrementCodePoints)
Iterate through a string based on code points instead of UTF-16 code units.
textenc.h
rtl_ustr_indexOfStr_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_indexOfStr_WithLength(const sal_Unicode *str, sal_Int32 len, const sal_Unicode *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the first occurrence of a substring within a string.
string.h
rtl_ustr_toInt64_WithLength
SAL_DLLPUBLIC sal_Int64 rtl_ustr_toInt64_WithLength(const sal_Unicode *str, sal_Int16 radix, sal_Int32 nStrLength) SAL_THROW_EXTERN_C()
Interpret a string as a long integer.
rtl_ustr_toAsciiLowerCase
SAL_DLLPUBLIC void rtl_ustr_toAsciiLowerCase(sal_Unicode *str) SAL_THROW_EXTERN_C()
Convert all ASCII uppercase letters to lowercase within a string.
rtl_ustr_indexOfChar_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_indexOfChar_WithLength(const sal_Unicode *str, sal_Int32 len, sal_Unicode ch) SAL_THROW_EXTERN_C()
Search for the first occurrence of a character within a string.
rtl_ustr_lastIndexOfAscii_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfAscii_WithLength(sal_Unicode const *str, sal_Int32 len, char const *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the last occurrence of an ASCII substring within a string.
rtl_ustr_valueOfUInt64
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfUInt64(sal_Unicode *str, sal_uInt64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an unsigned long integer.
saldllapi.h
rtl_uString_newReplaceAllUtf16LAsciiL
SAL_DLLPUBLIC void rtl_uString_newReplaceAllUtf16LAsciiL(rtl_uString **newStr, rtl_uString *str, sal_Unicode const *from, sal_Int32 fromLength, char const *to, sal_Int32 toLength) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
rtl_ustr_getLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_getLength(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Return the length of a string.
rtl_uString_newReplaceFirstUtf16LAsciiL
SAL_DLLPUBLIC void rtl_uString_newReplaceFirstUtf16LAsciiL(rtl_uString **newStr, rtl_uString *str, sal_Unicode const *from, sal_Int32 fromLength, char const *to, sal_Int32 toLength, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring.
rtl_uString_getStr
SAL_DLLPUBLIC sal_Unicode * rtl_uString_getStr(rtl_uString *str) SAL_THROW_EXTERN_C()
Return a pointer to the underlying character array of a string.
rtl_uString_newFromSubString
SAL_DLLPUBLIC void rtl_uString_newFromSubString(rtl_uString **newStr, const rtl_uString *from, sal_Int32 beginIndex, sal_Int32 count) SAL_THROW_EXTERN_C()
Allocate a new string that is a substring of this string.
rtl_ustr_compareIgnoreAsciiCase
SAL_DLLPUBLIC sal_Int32 rtl_ustr_compareIgnoreAsciiCase(const sal_Unicode *first, const sal_Unicode *second) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
rtl_ustr_lastIndexOfChar
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfChar(const sal_Unicode *str, sal_Unicode ch) SAL_THROW_EXTERN_C()
Search for the last occurrence of a character within a string.
rtl_ustr_trim_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_trim_WithLength(sal_Unicode *str, sal_Int32 len) SAL_THROW_EXTERN_C()
Remove white space from both ends of the string.
rtl_uString_newReplaceFirstAsciiLAsciiL
SAL_DLLPUBLIC void rtl_uString_newReplaceFirstAsciiLAsciiL(rtl_uString **newStr, rtl_uString *str, char const *from, sal_Int32 fromLength, char const *to, sal_Int32 toLength, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring.
rtl_ustr_asciil_reverseCompare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_asciil_reverseCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Char *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings from back to front.
rtl_uString_intern
SAL_DLLPUBLIC void rtl_uString_intern(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Return a canonical representation for a string.
sal_Bool
unsigned char sal_Bool
Definition: types.h:38
config.h
rtl_ustr_toUInt32
SAL_DLLPUBLIC sal_uInt32 rtl_ustr_toUInt32(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an unsigned integer.
rtl_uString_newReplaceFirstToAsciiL
SAL_DLLPUBLIC void rtl_uString_newReplaceFirstToAsciiL(rtl_uString **newStr, rtl_uString *str, rtl_uString const *from, char const *to, sal_Int32 toLength, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring.
rtl_ustr_toAsciiUpperCase_WithLength
SAL_DLLPUBLIC void rtl_ustr_toAsciiUpperCase_WithLength(sal_Unicode *str, sal_Int32 len) SAL_THROW_EXTERN_C()
Convert all ASCII lowercase letters to uppercase within a string.
oslInterlockedCount
sal_Int32 oslInterlockedCount
Definition: interlck.h:40
rtl_ustr_hashCode_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_hashCode_WithLength(const sal_Unicode *str, sal_Int32 len) SAL_THROW_EXTERN_C()
Return a hash code for a string.
rtl_ustr_lastIndexOfStr
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfStr(const sal_Unicode *str, const sal_Unicode *subStr) SAL_THROW_EXTERN_C()
Search for the last occurrence of a substring within a string.
rtl_uString_newFromStr
SAL_DLLPUBLIC void rtl_uString_newFromStr(rtl_uString **newStr, const sal_Unicode *value) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
rtl_uString_new
SAL_DLLPUBLIC void rtl_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
rtl_ustr_valueOfChar
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfChar(sal_Unicode *str, sal_Unicode ch) SAL_THROW_EXTERN_C()
Create the string representation of a character.
rtl_uString_assign
SAL_DLLPUBLIC void rtl_uString_assign(rtl_uString **str, rtl_uString *rightValue) SAL_THROW_EXTERN_C()
Assign a new value to a string.
rtl_ustr_replaceChar_WithLength
SAL_DLLPUBLIC void rtl_ustr_replaceChar_WithLength(sal_Unicode *str, sal_Int32 len, sal_Unicode oldChar, sal_Unicode newChar) SAL_THROW_EXTERN_C()
Replace all occurrences of a single character within a string.
rtl_uString_newReplaceFirst
SAL_DLLPUBLIC void rtl_uString_newReplaceFirst(rtl_uString **newStr, rtl_uString *str, rtl_uString const *from, rtl_uString const *to, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring.
rtl_uString_release
SAL_DLLPUBLIC void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
rtl_uString_newFromString
SAL_DLLPUBLIC void rtl_uString_newFromString(rtl_uString **newStr, const rtl_uString *value) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of another string.
rtl_ustr_reverseCompare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_reverseCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Unicode *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings from back to front.
rtl_uString_newReplace
SAL_DLLPUBLIC void rtl_uString_newReplace(rtl_uString **newStr, rtl_uString *str, sal_Unicode oldChar, sal_Unicode newChar) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a single character within another string.
rtl_ustr_lastIndexOfStr_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfStr_WithLength(const sal_Unicode *str, sal_Int32 len, const sal_Unicode *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the last occurrence of a substring within a string.
interlck.h
rtl_ustr_ascii_compare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Char *second) SAL_THROW_EXTERN_C()
Compare two strings.
rtl_ustr_ascii_compareIgnoreAsciiCase
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase(const sal_Unicode *first, const sal_Char *second) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
rtl_uString_ensureCapacity
SAL_DLLPUBLIC void rtl_uString_ensureCapacity(rtl_uString **str, sal_Int32 size) SAL_THROW_EXTERN_C()
Ensure a string has enough space for a given number of characters.
types.h
rtl_ustr_ascii_shortenedCompare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_shortenedCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Char *second, sal_Int32 shortenedLen) SAL_THROW_EXTERN_C()
Compare two strings with a maximum count of characters.
rtl_uString_alloc
SAL_DLLPUBLIC rtl_uString * rtl_uString_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C()
Allocate a new string containing space for a given number of characters.
rtl_ustr_toDouble
SAL_DLLPUBLIC double rtl_ustr_toDouble(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a double.
rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Char *second, sal_Int32 shortenedLen) SAL_THROW_EXTERN_C()
Compare two strings with a maximum count of characters, ignoring the case of ASCII characters.
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
rtl_uString_getToken
SAL_DLLPUBLIC sal_Int32 rtl_uString_getToken(rtl_uString **newStr, rtl_uString *str, sal_Int32 token, sal_Unicode cTok, sal_Int32 idx) SAL_THROW_EXTERN_C()
Create a new string by extracting a single token from another string.
rtl_ustr_indexOfStr
SAL_DLLPUBLIC sal_Int32 rtl_ustr_indexOfStr(const sal_Unicode *str, const sal_Unicode *subStr) SAL_THROW_EXTERN_C()
Search for the first occurrence of a substring within a string.
rtl_ustr_ascii_compare
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compare(const sal_Unicode *first, const sal_Char *second) SAL_THROW_EXTERN_C()
Compare two strings.
rtl_uString_newReplaceAllAsciiL
SAL_DLLPUBLIC void rtl_uString_newReplaceAllAsciiL(rtl_uString **newStr, rtl_uString *str, char const *from, sal_Int32 fromLength, rtl_uString const *to) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
rtl_ustr_compareIgnoreAsciiCase_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_compareIgnoreAsciiCase_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Unicode *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
rtl_uString_newConcat
SAL_DLLPUBLIC void rtl_uString_newConcat(rtl_uString **newStr, rtl_uString *left, rtl_uString *right) SAL_THROW_EXTERN_C()
Create a new string that is the concatenation of two other strings.
rtl_ustr_valueOfBoolean
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Char *second) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
rtl_ustr_shortenedCompare_WithLength
SAL_DLLPUBLIC sal_Int32 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()
Compare two strings with a maximum count of characters.
rtl_ustr_toInt32
SAL_DLLPUBLIC sal_Int32 rtl_ustr_toInt32(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an integer.
rtl_uString_newReplaceFirstAsciiLUtf16L
SAL_DLLPUBLIC void rtl_uString_newReplaceFirstAsciiLUtf16L(rtl_uString **newStr, rtl_uString *str, char const *from, sal_Int32 fromLength, sal_Unicode const *to, sal_Int32 toLength, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring.
rtl_ustr_valueOfFloat
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfFloat(sal_Unicode *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
rtl_ustr_compare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_compare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Unicode *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings.
rtl_ustr_lastIndexOfChar_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfChar_WithLength(const sal_Unicode *str, sal_Int32 len, sal_Unicode ch) SAL_THROW_EXTERN_C()
Search for the last occurrence of a character within a string.
rtl_uString_newFromLiteral
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const sal_Char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
rtl_uString_newReplaceAll
SAL_DLLPUBLIC void rtl_uString_newReplaceAll(rtl_uString **newStr, rtl_uString *str, rtl_uString const *from, rtl_uString const *to) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
rtl_uString_newFromCodePoints
SAL_DLLPUBLIC void rtl_uString_newFromCodePoints(rtl_uString **newString, sal_uInt32 const *codePoints, sal_Int32 codePointCount) SAL_THROW_EXTERN_C()
Allocate a new string from an array of Unicode code points.
rtl_uString_newReplaceAllToAsciiL
SAL_DLLPUBLIC void rtl_uString_newReplaceAllToAsciiL(rtl_uString **newStr, rtl_uString *str, rtl_uString const *from, char const *to, sal_Int32 toLength) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
rtl_uString_getLength
SAL_DLLPUBLIC sal_Int32 rtl_uString_getLength(const rtl_uString *str) SAL_THROW_EXTERN_C()
Return the length of a string.
rtl_uString_newReplaceFirstUtf16LUtf16L
SAL_DLLPUBLIC void rtl_uString_newReplaceFirstUtf16LUtf16L(rtl_uString **newStr, rtl_uString *str, sal_Unicode const *from, sal_Int32 fromLength, sal_Unicode const *to, sal_Int32 toLength, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring.
rtl_uString_acquire
SAL_DLLPUBLIC void rtl_uString_acquire(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Increment the reference count of a string.
rtl_uString_newFromAscii
SAL_DLLPUBLIC void rtl_uString_newFromAscii(rtl_uString **newStr, const sal_Char *value) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
sal_Unicode
sal_uInt16 sal_Unicode
Definition: types.h:141
rtl_ustr_asciil_reverseEquals_WithLength
SAL_DLLPUBLIC sal_Bool rtl_ustr_asciil_reverseEquals_WithLength(const sal_Unicode *first, const sal_Char *second, sal_Int32 len) SAL_THROW_EXTERN_C()
Compare two strings from back to front for equality.
rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(sal_Unicode const *first, sal_Int32 firstLen, char const *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
rtl_uString_newReplaceAllFromIndex
SAL_DLLPUBLIC void rtl_uString_newReplaceAllFromIndex(rtl_uString **newStr, rtl_uString *str, rtl_uString const *from, rtl_uString const *to, sal_Int32 fromIndex) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
rtl_uString_newConcatAsciiL
SAL_DLLPUBLIC void rtl_uString_newConcatAsciiL(rtl_uString **newString, rtl_uString *left, char const *right, sal_Int32 rightLength)
Create a new string that is the concatenation of two other strings.
rtl_ustr_indexOfAscii_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_indexOfAscii_WithLength(sal_Unicode const *str, sal_Int32 len, char const *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the first occurrence of an ASCII substring within a string.
rtl_uString_newToAsciiLowerCase
SAL_DLLPUBLIC void rtl_uString_newToAsciiLowerCase(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Create a new string by converting all ASCII uppercase letters to lowercase within another string.
rtl_ustr_toBoolean
SAL_DLLPUBLIC sal_Bool rtl_ustr_toBoolean(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a boolean.
rtl_uString_newConcatUtf16L
SAL_DLLPUBLIC void rtl_uString_newConcatUtf16L(rtl_uString **newString, rtl_uString *left, sal_Unicode const *right, sal_Int32 rightLength)
Create a new string that is the concatenation of two other strings.
rtl_uString_new_WithLength
SAL_DLLPUBLIC void rtl_uString_new_WithLength(rtl_uString **newStr, sal_Int32 nLen) SAL_THROW_EXTERN_C()
Allocate a new string containing space for a given number of characters.
rtl_uString_newReplaceFirstAsciiL
SAL_DLLPUBLIC void rtl_uString_newReplaceFirstAsciiL(rtl_uString **newStr, rtl_uString *str, char const *from, sal_Int32 fromLength, rtl_uString const *to, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring.
rtl_ustr_valueOfDouble
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfDouble(sal_Unicode *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
rtl_uString_newReplaceAllAsciiLUtf16L
SAL_DLLPUBLIC void rtl_uString_newReplaceAllAsciiLUtf16L(rtl_uString **newStr, rtl_uString *str, char const *from, sal_Int32 fromLength, sal_Unicode const *to, sal_Int32 toLength) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
rtl_ustr_toFloat
SAL_DLLPUBLIC float rtl_ustr_toFloat(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a float.
rtl_ustr_hashCode
SAL_DLLPUBLIC sal_Int32 rtl_ustr_hashCode(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Return a hash code for a string.
rtl_ustr_toInt64
SAL_DLLPUBLIC sal_Int64 rtl_ustr_toInt64(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as a long integer.
rtl_ustr_replaceChar
SAL_DLLPUBLIC void rtl_ustr_replaceChar(sal_Unicode *str, sal_Unicode oldChar, sal_Unicode newChar) SAL_THROW_EXTERN_C()
Replace all occurrences of a single character within a string.
SAL_THROW_EXTERN_C
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition: types.h:346
rtl_uString_internConvert
SAL_DLLPUBLIC void rtl_uString_internConvert(rtl_uString **newStr, const sal_Char *str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags, sal_uInt32 *pInfo) SAL_THROW_EXTERN_C()
Return a canonical representation for a string.
rtl_ustr_toAsciiLowerCase_WithLength
SAL_DLLPUBLIC void rtl_ustr_toAsciiLowerCase_WithLength(sal_Unicode *str, sal_Int32 len) SAL_THROW_EXTERN_C()
Convert all ASCII uppercase letters to lowercase within a string.
rtl_ustr_valueOfInt32
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfInt32(sal_Unicode *str, sal_Int32 i, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an integer.
rtl_uString_newTrim
SAL_DLLPUBLIC void rtl_uString_newTrim(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Create a new string by removing white space from both ends of another string.