LibreOffice LibreOffice 4.1 SDK C/C++ API Reference

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
string.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 _RTL_STRING_H_
21 #define _RTL_STRING_H_
22
23 #include "sal/config.h"
24
25 #include "osl/interlck.h"
26 #include "rtl/textcvt.h"
27 #include "sal/saldllapi.h"
28 #include "sal/types.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /* ======================================================================= */
35
48 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_getLength(
49 const sal_Char * str ) SAL_THROW_EXTERN_C();
50
69 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_compare(
70 const sal_Char * first, const sal_Char * second ) SAL_THROW_EXTERN_C();
71
97 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_compare_WithLength(
98 const sal_Char * first, sal_Int32 firstLen, const sal_Char * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
99
129 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_shortenedCompare_WithLength(
130 const sal_Char * first, sal_Int32 firstLen, const sal_Char * second, sal_Int32 secondLen, sal_Int32 shortenedLen ) SAL_THROW_EXTERN_C();
131
157 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_reverseCompare_WithLength(
158 const sal_Char * first, sal_Int32 firstLen, const sal_Char * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
159
179 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_compareIgnoreAsciiCase(
180 const sal_Char * first, const sal_Char * second ) SAL_THROW_EXTERN_C();
181
209 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_compareIgnoreAsciiCase_WithLength(
210 const sal_Char * first, sal_Int32 firstLen, const sal_Char * second, sal_Int32 secondLen ) SAL_THROW_EXTERN_C();
211
244 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
245 const sal_Char * first, sal_Int32 firstLen, const sal_Char * second, sal_Int32 secondLen, sal_Int32 shortenedLen ) SAL_THROW_EXTERN_C();
246
259 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_hashCode(
260 const sal_Char * str ) SAL_THROW_EXTERN_C();
261
277 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_hashCode_WithLength(
278 const sal_Char * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
279
294 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_indexOfChar(
295 const sal_Char * str, sal_Char ch ) SAL_THROW_EXTERN_C();
296
313 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_indexOfChar_WithLength(
314 const sal_Char * str, sal_Int32 len, sal_Char ch ) SAL_THROW_EXTERN_C();
315
331 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_lastIndexOfChar(
332 const sal_Char * str, sal_Char ch ) SAL_THROW_EXTERN_C();
333
351 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_lastIndexOfChar_WithLength(
352 const sal_Char * str, sal_Int32 len, sal_Char ch ) SAL_THROW_EXTERN_C();
353
369 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_indexOfStr(
370 const sal_Char * str, const sal_Char * subStr ) SAL_THROW_EXTERN_C();
371
394 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_indexOfStr_WithLength(
395 const sal_Char * str, sal_Int32 len, const sal_Char * subStr, sal_Int32 subLen ) SAL_THROW_EXTERN_C();
396
412 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_lastIndexOfStr(
413 const sal_Char * str, const sal_Char * subStr ) SAL_THROW_EXTERN_C();
414
437 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_lastIndexOfStr_WithLength(
438 const sal_Char * str, sal_Int32 len, const sal_Char * subStr, sal_Int32 subLen ) SAL_THROW_EXTERN_C();
439
454 SAL_DLLPUBLIC void SAL_CALL rtl_str_replaceChar(
455 sal_Char * str, sal_Char oldChar, sal_Char newChar ) SAL_THROW_EXTERN_C();
456
474 SAL_DLLPUBLIC void SAL_CALL rtl_str_replaceChar_WithLength(
475 sal_Char * str, sal_Int32 len, sal_Char oldChar, sal_Char newChar ) SAL_THROW_EXTERN_C();
476
486 SAL_DLLPUBLIC void SAL_CALL rtl_str_toAsciiLowerCase(
487 sal_Char * str ) SAL_THROW_EXTERN_C();
488
501 SAL_DLLPUBLIC void SAL_CALL rtl_str_toAsciiLowerCase_WithLength(
502 sal_Char * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
503
513 SAL_DLLPUBLIC void SAL_CALL rtl_str_toAsciiUpperCase(
514 sal_Char * str ) SAL_THROW_EXTERN_C();
515
528 SAL_DLLPUBLIC void SAL_CALL rtl_str_toAsciiUpperCase_WithLength(
529 sal_Char * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
530
543 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_trim(
544 sal_Char * str ) SAL_THROW_EXTERN_C();
545
562 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_trim_WithLength(
563 sal_Char * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
564
583 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_valueOfBoolean(
584 sal_Char * str, sal_Bool b ) SAL_THROW_EXTERN_C();
585 #define RTL_STR_MAX_VALUEOFBOOLEAN 6
586
600 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_valueOfChar(
601 sal_Char * str, sal_Char ch ) SAL_THROW_EXTERN_C();
602 #define RTL_STR_MAX_VALUEOFCHAR 2
603
623 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_valueOfInt32(
624 sal_Char * str, sal_Int32 i, sal_Int16 radix ) SAL_THROW_EXTERN_C();
625 #define RTL_STR_MIN_RADIX 2
626 #define RTL_STR_MAX_RADIX 36
627 #define RTL_STR_MAX_VALUEOFINT32 33
628
648 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_valueOfInt64(
649 sal_Char * str, sal_Int64 l, sal_Int16 radix ) SAL_THROW_EXTERN_C();
650 #define RTL_STR_MAX_VALUEOFINT64 65
651
671 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_valueOfUInt64(
672 sal_Char * str, sal_uInt64 l, sal_Int16 radix ) SAL_THROW_EXTERN_C();
673 #define RTL_STR_MAX_VALUEOFUINT64 65
674
690 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_valueOfFloat(
691 sal_Char * str, float f ) SAL_THROW_EXTERN_C();
692 #define RTL_STR_MAX_VALUEOFFLOAT 15
693
709 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_valueOfDouble(
710 sal_Char * str, double d ) SAL_THROW_EXTERN_C();
711 #define RTL_STR_MAX_VALUEOFDOUBLE 25
712
724 SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_str_toBoolean(
725 const sal_Char * str ) SAL_THROW_EXTERN_C();
726
743 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_toInt32(
744 const sal_Char * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
745
762 SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_str_toInt64(
763 const sal_Char * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
764
783 SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_str_toUInt64(
784 const sal_Char * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
785
798 SAL_DLLPUBLIC float SAL_CALL rtl_str_toFloat(
799 const sal_Char * str ) SAL_THROW_EXTERN_C();
800
813 SAL_DLLPUBLIC double SAL_CALL rtl_str_toDouble(
814 const sal_Char * str ) SAL_THROW_EXTERN_C();
815
816 /* ======================================================================= */
817
818 #ifdef SAL_W32
819 # pragma pack(push, 8)
820 #endif
821
825 typedef struct _rtl_String
826 {
827 oslInterlockedCount refCount; /* opaque */
828 sal_Int32 length;
829 sal_Char buffer[1];
830 } rtl_String;
833 #if defined(SAL_W32)
834 #pragma pack(pop)
835 #endif
836
837 /* ----------------------------------------------------------------------- */
838
844 SAL_DLLPUBLIC void SAL_CALL rtl_string_acquire( rtl_String * str ) SAL_THROW_EXTERN_C();
845
853 SAL_DLLPUBLIC void SAL_CALL rtl_string_release( rtl_String * str ) SAL_THROW_EXTERN_C();
854
861 SAL_DLLPUBLIC void SAL_CALL rtl_string_new( rtl_String ** newStr ) SAL_THROW_EXTERN_C();
862
884 SAL_DLLPUBLIC rtl_String * SAL_CALL rtl_string_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C();
885
899 SAL_DLLPUBLIC void SAL_CALL rtl_string_new_WithLength( rtl_String ** newStr, sal_Int32 len ) SAL_THROW_EXTERN_C();
900
914 SAL_DLLPUBLIC void SAL_CALL rtl_string_newFromString( rtl_String ** newStr, const rtl_String * value ) SAL_THROW_EXTERN_C();
915
929 SAL_DLLPUBLIC void SAL_CALL rtl_string_newFromStr( rtl_String ** newStr, const sal_Char * value ) SAL_THROW_EXTERN_C();
930
948 SAL_DLLPUBLIC void SAL_CALL rtl_string_newFromStr_WithLength( rtl_String ** newStr, const sal_Char * value, sal_Int32 len ) SAL_THROW_EXTERN_C();
949
964 SAL_DLLPUBLIC void SAL_CALL rtl_string_newFromSubString(
965 rtl_String ** newStr, const rtl_String * from,
966 sal_Int32 beginIndex, sal_Int32 count ) SAL_THROW_EXTERN_C();
967
972 SAL_DLLPUBLIC void SAL_CALL rtl_string_newFromLiteral( rtl_String ** newStr, const sal_Char * value, sal_Int32 len, sal_Int32 allocExtra ) SAL_THROW_EXTERN_C();
973
986 SAL_DLLPUBLIC void SAL_CALL rtl_string_assign( rtl_String ** str, rtl_String * rightValue ) SAL_THROW_EXTERN_C();
987
998 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_string_getLength( const rtl_String * str ) SAL_THROW_EXTERN_C();
999
1008 SAL_DLLPUBLIC sal_Char * SAL_CALL rtl_string_getStr( rtl_String * str ) SAL_THROW_EXTERN_C();
1009
1027 SAL_DLLPUBLIC void SAL_CALL rtl_string_newConcat( rtl_String ** newStr, rtl_String * left, rtl_String * right ) SAL_THROW_EXTERN_C();
1028
1058 SAL_DLLPUBLIC void SAL_CALL rtl_string_newReplaceStrAt(
1059 rtl_String ** newStr, rtl_String * str, sal_Int32 idx, sal_Int32 count, rtl_String * subStr ) SAL_THROW_EXTERN_C();
1060
1085 SAL_DLLPUBLIC void SAL_CALL rtl_string_newReplace(
1086 rtl_String ** newStr, rtl_String * str, sal_Char oldChar, sal_Char newChar ) SAL_THROW_EXTERN_C();
1087
1115 SAL_DLLPUBLIC void SAL_CALL rtl_string_newReplaceFirst(
1116 rtl_String ** newStr, rtl_String * str, char const * from,
1117 sal_Int32 fromLength, char const * to, sal_Int32 toLength,
1118 sal_Int32 * index) SAL_THROW_EXTERN_C();
1119
1143 SAL_DLLPUBLIC void SAL_CALL rtl_string_newReplaceAll(
1144 rtl_String ** newStr, rtl_String * str, char const * from,
1145 sal_Int32 fromLength, char const * to, sal_Int32 toLength)
1146 SAL_THROW_EXTERN_C();
1147
1167 SAL_DLLPUBLIC void SAL_CALL rtl_string_newToAsciiLowerCase(
1168 rtl_String ** newStr, rtl_String * str ) SAL_THROW_EXTERN_C();
1169
1189 SAL_DLLPUBLIC void SAL_CALL rtl_string_newToAsciiUpperCase(
1190 rtl_String ** newStr, rtl_String * str ) SAL_THROW_EXTERN_C();
1191
1211 SAL_DLLPUBLIC void SAL_CALL rtl_string_newTrim(
1212 rtl_String ** newStr, rtl_String * str ) SAL_THROW_EXTERN_C();
1213
1258 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_string_getToken(
1259 rtl_String ** newStr , rtl_String * str, sal_Int32 token, sal_Char cTok, sal_Int32 idx ) SAL_THROW_EXTERN_C();
1260
1261 /* ======================================================================= */
1262
1277 // The &foo[0] trick is intentional, it makes sure the type is char* or const char*
1278 // (plain cast to const char* would not work with non-const char foo[]="a", which seems to be allowed).
1279 // This is to avoid mistaken use with functions that accept string literals
1280 // (i.e. const char (&)[N]) where usage of this macro otherwise could match
1281 // the argument and a following int argument with a default value (e.g. OString::match()).
1282 #define RTL_CONSTASCII_STRINGPARAM( constAsciiStr ) (&(constAsciiStr)[0]), \
1283 ((sal_Int32)SAL_N_ELEMENTS(constAsciiStr)-1)
1284
1298 #define RTL_CONSTASCII_LENGTH( constAsciiStr ) ((sal_Int32)(SAL_N_ELEMENTS(constAsciiStr)-1))
1299
1300 /* ======================================================================= */
1301
1302 /* predefined constants for String-Conversion */
1303 #define OUSTRING_TO_OSTRING_CVTFLAGS (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_DEFAULT |\
1304 RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT |\
1305 RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE |\
1306 RTL_UNICODETOTEXT_FLAGS_PRIVATE_MAPTO0 |\
1307 RTL_UNICODETOTEXT_FLAGS_NOCOMPOSITE)
1308
1309 /* ----------------------------------------------------------------------- */
1310
1343 SAL_DLLPUBLIC void SAL_CALL rtl_uString2String(
1344 rtl_String ** newStr, const sal_Unicode * str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags ) SAL_THROW_EXTERN_C();
1345
1376 SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_convertUStringToString(
1377 rtl_String ** pTarget,
1378 sal_Unicode const * pSource,
1379 sal_Int32 nLength,
1380 rtl_TextEncoding nEncoding,
1381 sal_uInt32 nFlags)
1382 SAL_THROW_EXTERN_C();
1383
1400 SAL_DLLPUBLIC void SAL_CALL rtl_string_ensureCapacity( rtl_String ** str, sal_Int32 size ) SAL_THROW_EXTERN_C();
1401
1402 #ifdef __cplusplus
1403 }
1404 #endif
1405
1406 #endif /* _RTL_STRING_H_ */
1407
1408 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl_uString2String
SAL_DLLPUBLIC void rtl_uString2String(rtl_String **newStr, const sal_Unicode *str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags) SAL_THROW_EXTERN_C()
Create a new byte string by converting a Unicode string, using a specific text encoding.
rtl_string_newFromStr
SAL_DLLPUBLIC void rtl_string_newFromStr(rtl_String **newStr, const sal_Char *value) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
rtl_string_newToAsciiUpperCase
SAL_DLLPUBLIC void rtl_string_newToAsciiUpperCase(rtl_String **newStr, rtl_String *str) SAL_THROW_EXTERN_C()
Create a new string by converting all ASCII lowercase letters to uppercase within another string...
sal_Char
char sal_Char
Definition: types.h:122
rtl_string_alloc
SAL_DLLPUBLIC rtl_String * rtl_string_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C()
Allocate a new string containing space for a given number of characters.
rtl_str_lastIndexOfStr
SAL_DLLPUBLIC sal_Int32 rtl_str_lastIndexOfStr(const sal_Char *str, const sal_Char *subStr) SAL_THROW_EXTERN_C()
Search for the last occurrence of a substring within a string.
rtl_str_getLength
SAL_DLLPUBLIC sal_Int32 rtl_str_getLength(const sal_Char *str) SAL_THROW_EXTERN_C()
Return the length of a string.
rtl_str_indexOfChar
SAL_DLLPUBLIC sal_Int32 rtl_str_indexOfChar(const sal_Char *str, sal_Char ch) SAL_THROW_EXTERN_C()
Search for the first occurrence of a character within a string.
SAL_THROW_EXTERN_C
#define SAL_THROW_EXTERN_C()
Definition: types.h:358
rtl_string_newReplaceStrAt
SAL_DLLPUBLIC void rtl_string_newReplaceStrAt(rtl_String **newStr, rtl_String *str, sal_Int32 idx, sal_Int32 count, rtl_String *subStr) SAL_THROW_EXTERN_C()
Create a new string by replacing a substring of another string.
rtl_string_getToken
SAL_DLLPUBLIC sal_Int32 rtl_string_getToken(rtl_String **newStr, rtl_String *str, sal_Int32 token, sal_Char cTok, sal_Int32 idx) SAL_THROW_EXTERN_C()
Create a new string by extracting a single token from another string.
rtl_str_toDouble
SAL_DLLPUBLIC double rtl_str_toDouble(const sal_Char *str) SAL_THROW_EXTERN_C()
Interpret a string as a double.
rtl_string_newFromSubString
SAL_DLLPUBLIC void rtl_string_newFromSubString(rtl_String **newStr, const rtl_String *from, sal_Int32 beginIndex, sal_Int32 count) SAL_THROW_EXTERN_C()
Allocate a new string that is a substring of this string.
rtl_str_valueOfInt64
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfInt64(sal_Char *str, sal_Int64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of a long integer.
rtl_str_toInt32
SAL_DLLPUBLIC sal_Int32 rtl_str_toInt32(const sal_Char *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an integer.
rtl_str_lastIndexOfStr_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_lastIndexOfStr_WithLength(const sal_Char *str, sal_Int32 len, const sal_Char *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the last occurrence of a substring within a string.
rtl_str_toAsciiUpperCase
SAL_DLLPUBLIC void rtl_str_toAsciiUpperCase(sal_Char *str) SAL_THROW_EXTERN_C()
Convert all ASCII lowercase letters to uppercase within a string.
rtl_str_compareIgnoreAsciiCase_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_compareIgnoreAsciiCase_WithLength(const sal_Char *first, sal_Int32 firstLen, const sal_Char *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
rtl_string_newFromString
SAL_DLLPUBLIC void rtl_string_newFromString(rtl_String **newStr, const rtl_String *value) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of another string.
rtl_str_reverseCompare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_reverseCompare_WithLength(const sal_Char *first, sal_Int32 firstLen, const sal_Char *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings from back to front.
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
interlck.h
oslInterlockedCount
sal_Int32 oslInterlockedCount
Definition: interlck.h:32
rtl_string_release
SAL_DLLPUBLIC void rtl_string_release(rtl_String *str) SAL_THROW_EXTERN_C()
Decrement the reference count of a string.
rtl_str_toBoolean
SAL_DLLPUBLIC sal_Bool rtl_str_toBoolean(const sal_Char *str) SAL_THROW_EXTERN_C()
Interpret a string as a boolean.
rtl_str_valueOfUInt64
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfUInt64(sal_Char *str, sal_uInt64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an unsigned long integer.
rtl_str_indexOfChar_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_indexOfChar_WithLength(const sal_Char *str, sal_Int32 len, sal_Char ch) SAL_THROW_EXTERN_C()
Search for the first occurrence of a character within a string.
rtl_string_getLength
SAL_DLLPUBLIC sal_Int32 rtl_string_getLength(const rtl_String *str) SAL_THROW_EXTERN_C()
Return the length of a string.
rtl_string_newReplaceFirst
SAL_DLLPUBLIC void rtl_string_newReplaceFirst(rtl_String **newStr, rtl_String *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_str_indexOfStr
SAL_DLLPUBLIC sal_Int32 rtl_str_indexOfStr(const sal_Char *str, const sal_Char *subStr) SAL_THROW_EXTERN_C()
Search for the first occurrence of a substring within a string.
rtl_string_assign
SAL_DLLPUBLIC void rtl_string_assign(rtl_String **str, rtl_String *rightValue) SAL_THROW_EXTERN_C()
Assign a new value to a string.
saldllapi.h
rtl_string_getStr
SAL_DLLPUBLIC sal_Char * rtl_string_getStr(rtl_String *str) SAL_THROW_EXTERN_C()
Return a pointer to the underlying character array of a string.
rtl_string_newReplaceAll
SAL_DLLPUBLIC void rtl_string_newReplaceAll(rtl_String **newStr, rtl_String *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_str_valueOfBoolean
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfBoolean(sal_Char *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
rtl_str_hashCode_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_hashCode_WithLength(const sal_Char *str, sal_Int32 len) SAL_THROW_EXTERN_C()
Return a hash code for a string.
rtl_str_valueOfChar
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfChar(sal_Char *str, sal_Char ch) SAL_THROW_EXTERN_C()
Create the string representation of a character.
rtl_string_new_WithLength
SAL_DLLPUBLIC void rtl_string_new_WithLength(rtl_String **newStr, sal_Int32 len) SAL_THROW_EXTERN_C()
Allocate a new string containing space for a given number of characters.
rtl_str_lastIndexOfChar
SAL_DLLPUBLIC sal_Int32 rtl_str_lastIndexOfChar(const sal_Char *str, sal_Char ch) SAL_THROW_EXTERN_C()
Search for the last occurrence of a character within a string.
rtl_str_trim
SAL_DLLPUBLIC sal_Int32 rtl_str_trim(sal_Char *str) SAL_THROW_EXTERN_C()
Remove white space from both ends of a string.
rtl_string_new
SAL_DLLPUBLIC void rtl_string_new(rtl_String **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
rtl_str_toAsciiLowerCase_WithLength
SAL_DLLPUBLIC void rtl_str_toAsciiLowerCase_WithLength(sal_Char *str, sal_Int32 len) SAL_THROW_EXTERN_C()
Convert all ASCII uppercase letters to lowercase within a string.
rtl_str_compareIgnoreAsciiCase
SAL_DLLPUBLIC sal_Int32 rtl_str_compareIgnoreAsciiCase(const sal_Char *first, const sal_Char *second) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
rtl_str_replaceChar
SAL_DLLPUBLIC void rtl_str_replaceChar(sal_Char *str, sal_Char oldChar, sal_Char newChar) SAL_THROW_EXTERN_C()
Replace all occurrences of a single character within a string.
rtl_str_valueOfInt32
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfInt32(sal_Char *str, sal_Int32 i, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an integer.
rtl_str_shortenedCompare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_shortenedCompare_WithLength(const sal_Char *first, sal_Int32 firstLen, const sal_Char *second, sal_Int32 secondLen, sal_Int32 shortenedLen) SAL_THROW_EXTERN_C()
Compare two strings with a maximum count of characters.
rtl_str_lastIndexOfChar_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_lastIndexOfChar_WithLength(const sal_Char *str, sal_Int32 len, sal_Char ch) SAL_THROW_EXTERN_C()
Search for the last occurrence of a character within a string.
config.h
rtl_string_ensureCapacity
SAL_DLLPUBLIC void rtl_string_ensureCapacity(rtl_String **str, sal_Int32 size) SAL_THROW_EXTERN_C()
Ensure a string has enough space for a given number of characters.
rtl_string_acquire
SAL_DLLPUBLIC void rtl_string_acquire(rtl_String *str) SAL_THROW_EXTERN_C()
Increment the reference count of a string.
textcvt.h
sal_Unicode
sal_uInt16 sal_Unicode
Definition: types.h:134
rtl_str_toInt64
SAL_DLLPUBLIC sal_Int64 rtl_str_toInt64(const sal_Char *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as a long integer.
rtl_str_replaceChar_WithLength
SAL_DLLPUBLIC void rtl_str_replaceChar_WithLength(sal_Char *str, sal_Int32 len, sal_Char oldChar, sal_Char newChar) SAL_THROW_EXTERN_C()
Replace all occurrences of a single character within a string.
rtl_str_toAsciiUpperCase_WithLength
SAL_DLLPUBLIC void rtl_str_toAsciiUpperCase_WithLength(sal_Char *str, sal_Int32 len) SAL_THROW_EXTERN_C()
Convert all ASCII lowercase letters to uppercase within a string.
rtl_str_toAsciiLowerCase
SAL_DLLPUBLIC void rtl_str_toAsciiLowerCase(sal_Char *str) SAL_THROW_EXTERN_C()
Convert all ASCII uppercase letters to lowercase within a string.
rtl_str_compare
SAL_DLLPUBLIC sal_Int32 rtl_str_compare(const sal_Char *first, const sal_Char *second) SAL_THROW_EXTERN_C()
Compare two strings.
sal_Bool
unsigned char sal_Bool
Definition: types.h:37
rtl_string_newTrim
SAL_DLLPUBLIC void rtl_string_newTrim(rtl_String **newStr, rtl_String *str) SAL_THROW_EXTERN_C()
Create a new string by removing white space from both ends of another string.
rtl_string_newReplace
SAL_DLLPUBLIC void rtl_string_newReplace(rtl_String **newStr, rtl_String *str, sal_Char oldChar, sal_Char newChar) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a single character within another string...
rtl_string_newConcat
SAL_DLLPUBLIC void rtl_string_newConcat(rtl_String **newStr, rtl_String *left, rtl_String *right) SAL_THROW_EXTERN_C()
Create a new string that is the concatenation of two other strings.
rtl_str_toFloat
SAL_DLLPUBLIC float rtl_str_toFloat(const sal_Char *str) SAL_THROW_EXTERN_C()
Interpret a string as a float.
rtl_string_newFromStr_WithLength
SAL_DLLPUBLIC void rtl_string_newFromStr_WithLength(rtl_String **newStr, const sal_Char *value, sal_Int32 len) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
rtl_str_indexOfStr_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_indexOfStr_WithLength(const sal_Char *str, sal_Int32 len, const sal_Char *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the first occurrence of a substring within a string.
rtl_str_valueOfFloat
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfFloat(sal_Char *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
rtl_string_newFromLiteral
SAL_DLLPUBLIC void rtl_string_newFromLiteral(rtl_String **newStr, const sal_Char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
rtl_str_trim_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_trim_WithLength(sal_Char *str, sal_Int32 len) SAL_THROW_EXTERN_C()
Remove white space from both ends of the string.
rtl_convertUStringToString
SAL_DLLPUBLIC sal_Bool rtl_convertUStringToString(rtl_String **pTarget, sal_Unicode const *pSource, sal_Int32 nLength, rtl_TextEncoding nEncoding, sal_uInt32 nFlags) SAL_THROW_EXTERN_C()
Converts a Unicode string to a byte string, signalling failure.
rtl_TextEncoding
sal_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition: textenc.h:39
rtl_string_newToAsciiLowerCase
SAL_DLLPUBLIC void rtl_string_newToAsciiLowerCase(rtl_String **newStr, rtl_String *str) SAL_THROW_EXTERN_C()
Create a new string by converting all ASCII uppercase letters to lowercase within another string...
rtl_str_valueOfDouble
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfDouble(sal_Char *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
rtl_str_toUInt64
SAL_DLLPUBLIC sal_uInt64 rtl_str_toUInt64(const sal_Char *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an unsigned long integer.
rtl_str_hashCode
SAL_DLLPUBLIC sal_Int32 rtl_str_hashCode(const sal_Char *str) SAL_THROW_EXTERN_C()
Return a hash code for a string.
types.h
rtl_str_compare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_compare_WithLength(const sal_Char *first, sal_Int32 firstLen, const sal_Char *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings.
rtl_str_shortenedCompareIgnoreAsciiCase_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(const sal_Char *first, sal_Int32 firstLen, const sal_Char *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...