AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
4 #ifndef INCLUDED_RTL_USTRING_H
5 #define INCLUDED_RTL_USTRING_H
6 
7 #include "sal/config.h"
8 
9 #include "osl/interlck.h"
10 #include "rtl/string.h"
11 #include "rtl/textenc.h"
12 #include "sal/saldllapi.h"
13 #include "sal/types.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /* ======================================================================= */
20 
33 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_getLength(
34  const sal_Unicode * str ) SAL_THROW_EXTERN_C();
35 
54 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_compare(
55  const sal_Unicode * first, const sal_Unicode * second ) SAL_THROW_EXTERN_C();
56 
83  const sal_Unicode * first, sal_Int32 firstLen, const sal_Unicode * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
84 
115  const sal_Unicode * first, sal_Int32 firstLen, const sal_Unicode * second, sal_Int32 secondLen, sal_Int32 shortenedLen ) SAL_THROW_EXTERN_C();
116 
143  const sal_Unicode * first, sal_Int32 firstLen, const sal_Unicode * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
144 
167  const sal_Unicode * first, const char * second, sal_Int32 len ) SAL_THROW_EXTERN_C();
168 
189  const sal_Unicode * first, const sal_Unicode * second ) SAL_THROW_EXTERN_C();
190 
219  const sal_Unicode * first, sal_Int32 firstLen, const sal_Unicode * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
220 
254  const sal_Unicode * first, sal_Int32 firstLen, const sal_Unicode * second, sal_Int32 secondLen, sal_Int32 shortenedLen ) SAL_THROW_EXTERN_C();
255 
279 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_ascii_compare(
280  const sal_Unicode * first, const char * second ) SAL_THROW_EXTERN_C();
281 
309  const sal_Unicode * first, sal_Int32 firstLen, const char * second ) SAL_THROW_EXTERN_C();
310 
342  const sal_Unicode * first, sal_Int32 firstLen, const char * second, sal_Int32 shortenedLen ) SAL_THROW_EXTERN_C();
343 
374  const sal_Unicode * first, sal_Int32 firstLen, const char * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
375 
401  const sal_Unicode * first, const char * second ) SAL_THROW_EXTERN_C();
402 
432  const sal_Unicode * first, sal_Int32 firstLen, const char * second ) SAL_THROW_EXTERN_C();
433 
466  sal_Unicode const * first, sal_Int32 firstLen,
467  char const * second, sal_Int32 secondLen) SAL_THROW_EXTERN_C();
468 
503  const sal_Unicode * first, sal_Int32 firstLen, const char * second, sal_Int32 shortenedLen ) SAL_THROW_EXTERN_C();
504 
517 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_hashCode(
518  const sal_Unicode * str ) SAL_THROW_EXTERN_C();
519 
536  const sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
537 
552 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_indexOfChar(
553  const sal_Unicode * str, sal_Unicode ch ) SAL_THROW_EXTERN_C();
554 
572  const sal_Unicode * str, sal_Int32 len, sal_Unicode ch ) SAL_THROW_EXTERN_C();
573 
589 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_lastIndexOfChar(
590  const sal_Unicode * str, sal_Unicode ch ) SAL_THROW_EXTERN_C();
591 
610  const sal_Unicode * str, sal_Int32 len, sal_Unicode ch ) SAL_THROW_EXTERN_C();
611 
627 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_indexOfStr(
628  const sal_Unicode * str, const sal_Unicode * subStr ) SAL_THROW_EXTERN_C();
629 
653  const sal_Unicode * str, sal_Int32 len, const sal_Unicode * subStr, sal_Int32 subLen ) SAL_THROW_EXTERN_C();
654 
680  sal_Unicode const * str, sal_Int32 len,
681  char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C();
682 
698 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_lastIndexOfStr(
699  const sal_Unicode * str, const sal_Unicode * subStr ) SAL_THROW_EXTERN_C();
700 
724  const sal_Unicode * str, sal_Int32 len, const sal_Unicode * subStr, sal_Int32 subLen ) SAL_THROW_EXTERN_C();
725 
751  sal_Unicode const * str, sal_Int32 len,
752  char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C();
753 
768 SAL_DLLPUBLIC void SAL_CALL rtl_ustr_replaceChar(
769  sal_Unicode * str, sal_Unicode oldChar, sal_Unicode newChar ) SAL_THROW_EXTERN_C();
770 
789  sal_Unicode * str, sal_Int32 len, sal_Unicode oldChar, sal_Unicode newChar ) SAL_THROW_EXTERN_C();
790 
802 
816  sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
817 
829 
843  sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
844 
857 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_trim(
859 
876 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_trim_WithLength(
877  sal_Unicode * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
878 
897 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_valueOfBoolean(
899 #define RTL_USTR_MAX_VALUEOFBOOLEAN RTL_STR_MAX_VALUEOFBOOLEAN
900 
914 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_valueOfChar(
916 #define RTL_USTR_MAX_VALUEOFCHAR RTL_STR_MAX_VALUEOFCHAR
917 
937 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_valueOfInt32(
938  sal_Unicode * str, sal_Int32 i, sal_Int16 radix ) SAL_THROW_EXTERN_C();
939 #define RTL_USTR_MIN_RADIX RTL_STR_MIN_RADIX
940 #define RTL_USTR_MAX_RADIX RTL_STR_MAX_RADIX
941 #define RTL_USTR_MAX_VALUEOFINT32 RTL_STR_MAX_VALUEOFINT32
942 
962 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_valueOfInt64(
963  sal_Unicode * str, sal_Int64 l, sal_Int16 radix ) SAL_THROW_EXTERN_C();
964 #define RTL_USTR_MAX_VALUEOFINT64 RTL_STR_MAX_VALUEOFINT64
965 
985 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_valueOfUInt64(
986  sal_Unicode * str, sal_uInt64 l, sal_Int16 radix ) SAL_THROW_EXTERN_C();
987 #define RTL_USTR_MAX_VALUEOFUINT64 RTL_STR_MAX_VALUEOFUINT64
988 
1004 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_valueOfFloat(
1005  sal_Unicode * str, float f ) SAL_THROW_EXTERN_C();
1006 #define RTL_USTR_MAX_VALUEOFFLOAT RTL_STR_MAX_VALUEOFFLOAT
1007 
1023 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_valueOfDouble(
1024  sal_Unicode * str, double d ) SAL_THROW_EXTERN_C();
1025 #define RTL_USTR_MAX_VALUEOFDOUBLE RTL_STR_MAX_VALUEOFDOUBLE
1026 
1039  const sal_Unicode * str ) SAL_THROW_EXTERN_C();
1040 
1057 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_ustr_toInt32(
1058  const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1059 
1078 SAL_DLLPUBLIC sal_uInt32 SAL_CALL rtl_ustr_toUInt32(
1079  const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1080 
1097 SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_ustr_toInt64(
1098  const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1099 
1121 SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_ustr_toInt64_WithLength(
1122  const sal_Unicode * str, sal_Int16 radix, sal_Int32 nStrLength ) SAL_THROW_EXTERN_C();
1123 
1142 SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_ustr_toUInt64(
1143  const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
1144 
1157 SAL_DLLPUBLIC float SAL_CALL rtl_ustr_toFloat(
1158  const sal_Unicode * str ) SAL_THROW_EXTERN_C();
1159 
1172 SAL_DLLPUBLIC double SAL_CALL rtl_ustr_toDouble(
1173  const sal_Unicode * str ) SAL_THROW_EXTERN_C();
1174 
1175 /* ======================================================================= */
1176 
1177 #if defined(_WIN32)
1178 #pragma pack(push, 4)
1179 #endif
1180 
1184 typedef struct SAL_DLLPUBLIC_RTTI _rtl_uString
1185 {
1186  oslInterlockedCount refCount; /* opaque */
1187  sal_Int32 length;
1188  sal_Unicode buffer[1];
1189 } rtl_uString;
1192 #if defined(_WIN32)
1193 #pragma pack(pop)
1194 #endif
1195 
1196 /* ----------------------------------------------------------------------- */
1197 
1203 SAL_DLLPUBLIC void SAL_CALL rtl_uString_acquire(
1204  rtl_uString * str ) SAL_THROW_EXTERN_C() SAL_HOT;
1205 
1213 SAL_DLLPUBLIC void SAL_CALL rtl_uString_release(
1214  rtl_uString * str ) SAL_THROW_EXTERN_C() SAL_HOT;
1215 
1222 SAL_DLLPUBLIC void SAL_CALL rtl_uString_new(
1223  rtl_uString ** newStr ) SAL_THROW_EXTERN_C();
1224 
1247 SAL_DLLPUBLIC rtl_uString * SAL_CALL rtl_uString_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C();
1248 
1263  rtl_uString ** newStr, sal_Int32 nLen ) SAL_THROW_EXTERN_C();
1264 
1279  rtl_uString ** newStr, const rtl_uString * value ) SAL_THROW_EXTERN_C();
1280 
1295  rtl_uString ** newStr, const sal_Unicode * value ) SAL_THROW_EXTERN_C();
1296 
1315  rtl_uString ** newStr, const sal_Unicode * value, sal_Int32 len ) SAL_THROW_EXTERN_C();
1316 
1332  rtl_uString ** newStr, const rtl_uString * from,
1333  sal_Int32 beginIndex, sal_Int32 count ) SAL_THROW_EXTERN_C();
1334 
1353  rtl_uString ** newStr, const char * value ) SAL_THROW_EXTERN_C();
1354 
1360  rtl_uString ** newStr, const char * value, sal_Int32 len,
1361  sal_Int32 allocExtra ) SAL_THROW_EXTERN_C();
1362 
1383  rtl_uString ** newString, sal_uInt32 const * codePoints,
1384  sal_Int32 codePointCount) SAL_THROW_EXTERN_C();
1385 
1398 SAL_DLLPUBLIC void SAL_CALL rtl_uString_assign(
1399  rtl_uString ** str, rtl_uString * rightValue ) SAL_THROW_EXTERN_C();
1400 
1411 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_uString_getLength(
1412  const rtl_uString * str ) SAL_THROW_EXTERN_C();
1413 
1423  rtl_uString * str ) SAL_THROW_EXTERN_C();
1424 
1442 SAL_DLLPUBLIC void SAL_CALL rtl_uString_newConcat(
1443  rtl_uString ** newStr, rtl_uString * left, rtl_uString * right ) SAL_THROW_EXTERN_C();
1444 
1466  rtl_uString ** newString, rtl_uString * left, char const * right,
1467  sal_Int32 rightLength);
1468 
1488  rtl_uString ** newString, rtl_uString * left, sal_Unicode const * right,
1489  sal_Int32 rightLength);
1490 
1521  rtl_uString ** newStr, rtl_uString * str, sal_Int32 idx, sal_Int32 count, rtl_uString * subStr ) SAL_THROW_EXTERN_C();
1522 
1523 #ifdef LIBO_INTERNAL_ONLY
1524 SAL_DLLPUBLIC void SAL_CALL rtl_uString_newReplaceStrAtUtf16L(
1525  rtl_uString ** newStr, rtl_uString * str, sal_Int32 idx, sal_Int32 count, sal_Unicode const * subStr, sal_Int32 substrLen ) SAL_THROW_EXTERN_C();
1526 #endif
1527 
1553  rtl_uString ** newStr, rtl_uString * str, sal_Unicode oldChar, sal_Unicode newChar ) SAL_THROW_EXTERN_C();
1554 
1577  rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
1578  rtl_uString const * to, sal_Int32 * index) SAL_THROW_EXTERN_C();
1579 
1605  rtl_uString ** newStr, rtl_uString * str, char const * from,
1606  sal_Int32 fromLength, rtl_uString const * to, sal_Int32 * index)
1608 
1634  rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
1635  char const * to, sal_Int32 toLength, sal_Int32 * index)
1637 
1666  rtl_uString ** newStr, rtl_uString * str, char const * from,
1667  sal_Int32 fromLength, char const * to, sal_Int32 toLength,
1668  sal_Int32 * index) SAL_THROW_EXTERN_C();
1669 
1702  rtl_uString ** newStr, rtl_uString * str, char const * from,
1703  sal_Int32 fromLength, sal_Unicode const * to, sal_Int32 toLength,
1704  sal_Int32 * index) SAL_THROW_EXTERN_C();
1705 
1738  rtl_uString ** newStr, rtl_uString * str, sal_Unicode const * from,
1739  sal_Int32 fromLength, char const * to, sal_Int32 toLength,
1740  sal_Int32 * index) SAL_THROW_EXTERN_C();
1741 
1774  rtl_uString ** newStr, rtl_uString * str, sal_Unicode const * from,
1775  sal_Int32 fromLength, sal_Unicode const * to, sal_Int32 toLength,
1776  sal_Int32 * index) SAL_THROW_EXTERN_C();
1777 
1796  rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
1797  rtl_uString const * to) SAL_THROW_EXTERN_C();
1798 
1819  rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
1820  rtl_uString const * to, sal_Int32 fromIndex) SAL_THROW_EXTERN_C();
1821 
1843  rtl_uString ** newStr, rtl_uString * str, char const * from,
1844  sal_Int32 fromLength, rtl_uString const * to) SAL_THROW_EXTERN_C();
1845 
1867  rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
1868  char const * to, sal_Int32 toLength) SAL_THROW_EXTERN_C();
1869 
1894  rtl_uString ** newStr, rtl_uString * str, char const * from,
1895  sal_Int32 fromLength, char const * to, sal_Int32 toLength)
1897 
1925  rtl_uString ** newStr, rtl_uString * str, char const * from,
1926  sal_Int32 fromLength, sal_Unicode const * to, sal_Int32 toLength)
1928 
1956  rtl_uString ** newStr, rtl_uString * str, sal_Unicode const * from,
1957  sal_Int32 fromLength, char const * to, sal_Int32 toLength)
1959 
1987  rtl_uString ** newStr, rtl_uString * str, sal_Unicode const * from,
1988  sal_Int32 fromLength, sal_Unicode const * to, sal_Int32 toLength)
1990 
1991 #if defined LIBO_INTERNAL_ONLY
1992 
2020 SAL_DLLPUBLIC void SAL_CALL rtl_uString_newReplaceAllFromIndexUtf16LUtf16L(
2021  rtl_uString ** newStr, rtl_uString * str, sal_Unicode const * from,
2022  sal_Int32 fromLength, sal_Unicode const * to, sal_Int32 toLength, sal_Int32 fromIndex)
2024 #endif
2025 
2046  rtl_uString ** newStr, rtl_uString * str ) SAL_THROW_EXTERN_C();
2047 
2068  rtl_uString ** newStr, rtl_uString * str ) SAL_THROW_EXTERN_C();
2069 
2091 SAL_DLLPUBLIC void SAL_CALL rtl_uString_newTrim(
2092  rtl_uString ** newStr, rtl_uString * str ) SAL_THROW_EXTERN_C();
2093 
2138 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_uString_getToken(
2139  rtl_uString ** newStr , rtl_uString * str, sal_Int32 token, sal_Unicode cTok, sal_Int32 idx ) SAL_THROW_EXTERN_C();
2140 
2141 /* ======================================================================= */
2142 
2156 // The &foo[0] trick is intentional, it makes sure the type is char* or const char*
2157 // (plain cast to const char* would not work with non-const char foo[]="a", which seems to be allowed).
2158 // This is to avoid mistaken use with functions that accept string literals
2159 // (i.e. const char (&)[N]) where usage of this macro otherwise could match
2160 // the argument and a following int argument with a default value (e.g. OUString::match()).
2161 #define RTL_CONSTASCII_USTRINGPARAM( constAsciiStr ) (&(constAsciiStr)[0]), \
2162  ((sal_Int32)(SAL_N_ELEMENTS(constAsciiStr)-1)), RTL_TEXTENCODING_ASCII_US
2163 
2164 /* ======================================================================= */
2165 
2166 /* predefined constants for String-Conversion */
2167 #define OSTRING_TO_OUSTRING_CVTFLAGS (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |\
2168  RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |\
2169  RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT)
2170 
2171 /* ----------------------------------------------------------------------- */
2172 
2205 SAL_DLLPUBLIC void SAL_CALL rtl_string2UString(
2206  rtl_uString ** newStr, const char * str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags ) SAL_THROW_EXTERN_C();
2207 
2208 /* ======================================================================= */
2209 /* Interning methods */
2210 
2230 SAL_DLLPUBLIC void SAL_CALL rtl_uString_intern(
2231  rtl_uString ** newStr, rtl_uString * str) SAL_THROW_EXTERN_C();
2232 
2269  rtl_uString ** newStr,
2270  const char * str,
2271  sal_Int32 len,
2272  rtl_TextEncoding encoding,
2273  sal_uInt32 convertFlags,
2274  sal_uInt32 *pInfo) SAL_THROW_EXTERN_C();
2275 
2328 SAL_DLLPUBLIC sal_uInt32 SAL_CALL rtl_uString_iterateCodePoints(
2329  rtl_uString const * string, sal_Int32 * indexUtf16,
2330  sal_Int32 incrementCodePoints);
2331 
2366  rtl_uString ** target, char const * source, sal_Int32 length,
2367  rtl_TextEncoding encoding, sal_uInt32 flags) SAL_THROW_EXTERN_C();
2368 
2385 SAL_DLLPUBLIC void SAL_CALL rtl_uString_ensureCapacity( rtl_uString ** str, sal_Int32 size ) SAL_THROW_EXTERN_C();
2386 
2387 #ifdef __cplusplus
2388 }
2389 #endif
2390 
2391 #endif // INCLUDED_RTL_USTRING_H
2392 
2393 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const char *second) SAL_THROW_EXTERN_C()
Compare two strings.
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.
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.
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.
SAL_DLLPUBLIC float rtl_ustr_toFloat(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a float.
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...
unsigned char sal_Bool
Definition: types.h:18
SAL_DLLPUBLIC void rtl_ustr_toAsciiUpperCase(sal_Unicode *str) SAL_THROW_EXTERN_C()
Convert all ASCII lowercase letters to uppercase within a string.
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.
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...
SAL_DLLPUBLIC sal_Int32 rtl_ustr_getLength(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Return the length of a string.
SAL_DLLPUBLIC void rtl_uString_acquire(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Increment the reference count of a string.
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.
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_DLLPUBLIC void rtl_uString_newFromAscii(rtl_uString **newStr, const char *value) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
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...
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.
sal_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition: textenc.h:17
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_shortenedCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const char *second, sal_Int32 shortenedLen) SAL_THROW_EXTERN_C()
Compare two strings with a maximum count of characters.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const char *second) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfChar(sal_Unicode *str, sal_Unicode ch) SAL_THROW_EXTERN_C()
Create the string representation of a character.
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.
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...
sal_uInt16 sal_Unicode
Definition: types.h:103
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.
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.
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.
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...
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_DLLPUBLIC void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
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.
SAL_DLLPUBLIC void rtl_uString_assign(rtl_uString **str, rtl_uString *rightValue) SAL_THROW_EXTERN_C()
Assign a new value to a string.
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.
CPPU_DLLPUBLIC void SAL_THROW_EXTERN_C()
This method is called to wait for a reply of a previously sent request.
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.
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...
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.
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.
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.
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.
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.
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.
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...
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...
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfFloat(sal_Unicode *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
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.
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.
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.
SAL_DLLPUBLIC void rtl_uString_internConvert(rtl_uString **newStr, const 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.
SAL_DLLPUBLIC sal_Bool rtl_ustr_asciil_reverseEquals_WithLength(const sal_Unicode *first, const char *second, sal_Int32 len) SAL_THROW_EXTERN_C()
Compare two strings from back to front for equality.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase(const sal_Unicode *first, const char *second) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
SAL_DLLPUBLIC void rtl_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
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...
SAL_DLLPUBLIC sal_Bool rtl_ustr_toBoolean(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a boolean.
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.
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.
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.
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.
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.
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.
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...
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...
SAL_DLLPUBLIC void rtl_ustr_toAsciiLowerCase(sal_Unicode *str) SAL_THROW_EXTERN_C()
Convert all ASCII uppercase letters to lowercase within a string.
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.
sal_Int32 oslInterlockedCount
Definition: interlck.h:24
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...
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.
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.
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.
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...
SAL_DLLPUBLIC sal_Int32 rtl_ustr_hashCode(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Return a hash code for a string.
SAL_DLLPUBLIC double rtl_ustr_toDouble(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a double.
SAL_DLLPUBLIC void rtl_uString_intern(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Return a canonical representation for a string.
SAL_DLLPUBLIC void rtl_string2UString(rtl_uString **newStr, const 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.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_compare(const sal_Unicode *first, const sal_Unicode *second) SAL_THROW_EXTERN_C()
Compare two strings.
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...
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.
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...
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.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
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.
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.
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...
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compare(const sal_Unicode *first, const char *second) SAL_THROW_EXTERN_C()
Compare two strings.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_toInt32(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an integer.
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.
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.
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.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_asciil_reverseCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const char *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings from back to front.
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.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_trim(sal_Unicode *str) SAL_THROW_EXTERN_C()
Remove white space from both ends of a string.
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...
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...
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
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.
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.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const 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 sal_Int32 rtl_uString_getLength(const rtl_uString *str) SAL_THROW_EXTERN_C()
Return the length of a string.
#define SAL_DLLPUBLIC
Definition: saldllapi.h:14
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...
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfDouble(sal_Unicode *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
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.