20 #ifndef INCLUDED_RTL_USTRING_HXX 21 #define INCLUDED_RTL_USTRING_HXX 37 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 38 #include <config_global.h> 47 #ifdef RTL_STRING_UNITTEST 48 #define rtl rtlunittest 54 #ifdef RTL_STRING_UNITTEST 58 #if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 72 explicit SAL_CONSTEXPR OUStringLiteral(
const char (&str)[ N ] ) : size( N - 1 ), data( str )
133 #ifndef _MSC_VER // TODO? 134 #if defined LIBO_INTERNAL_ONLY 183 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST_CONCAT 234 template<
typename T >
249 #ifdef RTL_STRING_UNITTEST 250 rtl_string_unittest_const_literal =
true;
254 #if defined LIBO_INTERNAL_ONLY 275 #ifdef RTL_STRING_UNITTEST 280 template<
typename T >
285 rtl_string_unittest_invalid_conversion =
true;
291 template<
typename T >
296 rtl_string_unittest_invalid_conversion =
true;
300 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 317 OUString(OUStringLiteral literal): pData(NULL) {
344 throw std::bad_alloc();
365 sal_uInt32
const * codePoints, sal_Int32 codePointCount):
370 throw std::bad_alloc();
374 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 379 template<
typename T1,
typename T2 >
380 OUString(
const OUStringConcat< T1, T2 >& c )
382 const sal_Int32 l = c.length();
414 {
return *
reinterpret_cast< OUString const *
>( ppHandle ); }
427 #ifndef _MSC_VER // TODO? 428 #if defined LIBO_INTERNAL_ONLY 458 template<
typename T >
475 #if defined LIBO_INTERNAL_ONLY 480 operator =(T & literal) {
500 #if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER 507 #if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER 508 void operator+=(
OUString const &) && =
delete;
519 operator +=(T & literal)
520 #if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER 532 #if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER 535 operator +=(T &) && =
delete;
538 #if defined LIBO_INTERNAL_ONLY 543 operator +=(T & literal)
544 #if HAVE_CXX11_REF_QUALIFIER 554 #if HAVE_CXX11_REF_QUALIFIER 558 operator +=(T &) && =
delete;
562 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 567 template<
typename T1,
typename T2 >
568 OUString& operator+=(
const OUStringConcat< T1, T2 >& c )
569 #if HAVE_CXX11_REF_QUALIFIER 573 sal_Int32 l = c.length();
578 sal_Unicode* end = c.addData( pData->buffer + pData->length );
583 #if HAVE_CXX11_REF_QUALIFIER 584 template<
typename T1,
typename T2>
void operator +=(
585 OUStringConcat<T1, T2>
const &) && =
delete;
618 return pData->length == 0;
641 assert(index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength()));
642 return getStr()[index];
660 str.pData->buffer, str.pData->length );
681 str.pData->buffer, str.pData->length, maxLength );
699 str.pData->buffer, str.pData->length );
707 template<
typename T >
713 pData->buffer, pData->length,
718 #if defined LIBO_INTERNAL_ONLY 723 reverseCompareTo(T & literal)
const {
725 pData->buffer, pData->length,
744 if ( pData->length != str.pData->length )
746 if ( pData == str.pData )
749 str.pData->buffer, str.pData->length ) == 0;
768 if ( pData->length != str.pData->length )
770 if ( pData == str.pData )
773 str.pData->buffer, str.pData->length ) == 0;
794 str.pData->buffer, str.pData->length );
803 template<
typename T >
812 pData->buffer, pData->length,
818 #if defined LIBO_INTERNAL_ONLY 822 equalsIgnoreAsciiCase(T & literal)
const {
825 pData->buffer, pData->length,
851 str.pData->buffer, str.pData->length, str.pData->length ) == 0;
859 template<
typename T >
866 pData->buffer+fromIndex, pData->length-fromIndex,
873 #if defined LIBO_INTERNAL_ONLY 877 match(T & literal, sal_Int32 fromIndex = 0)
const {
878 assert(fromIndex >= 0);
881 pData->buffer + fromIndex, pData->length - fromIndex,
911 str.pData->buffer, str.pData->length,
912 str.pData->length ) == 0;
920 template<
typename T >
927 pData->buffer+fromIndex, pData->length-fromIndex,
934 #if defined LIBO_INTERNAL_ONLY 938 matchIgnoreAsciiCase(T & literal, sal_Int32 fromIndex = 0)
const {
939 assert(fromIndex >= 0);
942 pData->buffer + fromIndex, pData->length - fromIndex,
995 "replace s1.compareToAscii(s2, strlen(s2)) == 0 with s1.startsWith(s2)")
996 sal_Int32 compareToAscii( const
sal_Char * asciiStr, sal_Int32 maxLength )
const 999 asciiStr, maxLength );
1024 asciiStr, asciiStrLength );
1067 if ( pData->length != asciiStrLength )
1071 pData->buffer, asciiStr, asciiStrLength );
1142 if ( pData->length != asciiStrLength )
1172 asciiStr, asciiStrLength ) == 0;
1179 #if SAL_TYPES_SIZEOFLONG == 8 1210 asciiStr, asciiStrLength ) == 0;
1217 #if SAL_TYPES_SIZEOFLONG == 8 1237 bool b = match(str);
1238 if (b && rest != NULL) {
1249 template<
typename T >
1251 T & literal,
OUString * rest = NULL)
const 1257 <= sal_uInt32(pData->length))
1263 if (b && rest != NULL) {
1270 #if defined LIBO_INTERNAL_ONLY 1272 template<
typename T>
1274 startsWith(T & literal,
OUString * rest =
nullptr)
const {
1277 <= sal_uInt32(pData->length))
1285 if (b && rest !=
nullptr) {
1316 bool b = matchIgnoreAsciiCase(str);
1317 if (b && rest != NULL) {
1328 template<
typename T >
1342 if (b && rest != NULL) {
1349 #if defined LIBO_INTERNAL_ONLY 1351 template<
typename T>
1353 startsWithIgnoreAsciiCase(T & literal,
OUString * rest =
nullptr)
const {
1356 <= sal_uInt32(pData->length))
1364 if (b && rest !=
nullptr) {
1388 && match(str, getLength() - str.
getLength());
1389 if (b && rest != NULL) {
1390 *rest = copy(0, getLength() - str.
getLength());
1400 template<
typename T >
1408 <= sal_uInt32(pData->length))
1410 (pData->buffer + pData->length
1415 if (b && rest != NULL) {
1424 #if defined LIBO_INTERNAL_ONLY 1426 template<
typename T>
1428 endsWith(T & literal,
OUString * rest =
nullptr)
const {
1431 <= sal_uInt32(pData->length))
1433 (pData->buffer + pData->length
1440 if (b && rest !=
nullptr) {
1464 return asciiStrLength <= pData->length
1466 pData->buffer + pData->length - asciiStrLength, asciiStr,
1493 && matchIgnoreAsciiCase(str, getLength() - str.
getLength());
1494 if (b && rest != NULL) {
1495 *rest = copy(0, getLength() - str.
getLength());
1505 template<
typename T >
1513 <= sal_uInt32(pData->length))
1515 (pData->buffer + pData->length
1522 if (b && rest != NULL) {
1531 #if defined LIBO_INTERNAL_ONLY 1533 template<
typename T>
1535 endsWithIgnoreAsciiCase(T & literal,
OUString * rest =
nullptr)
const {
1538 <= sal_uInt32(pData->length))
1540 (pData->buffer + pData->length
1547 if (b && rest !=
nullptr) {
1568 char const * asciiStr, sal_Int32 asciiStrLength)
const 1570 return asciiStrLength <= pData->length
1572 pData->buffer + pData->length - asciiStrLength,
1573 asciiStrLength, asciiStr, asciiStrLength)
1578 {
return rStr1.
equals(rStr2); }
1580 {
return rStr1.
compareTo( pStr2 ) == 0; }
1592 {
return rStr1.
compareTo( rStr2 ) < 0; }
1594 {
return rStr1.
compareTo( rStr2 ) > 0; }
1596 {
return rStr1.
compareTo( rStr2 ) <= 0; }
1598 {
return rStr1.
compareTo( rStr2 ) >= 0; }
1607 template<
typename T >
1623 template<
typename T >
1639 template<
typename T >
1655 template<
typename T >
1665 #if defined LIBO_INTERNAL_ONLY 1667 template<
typename T>
friend inline 1672 string.pData->buffer,
string.pData->length,
1679 template<
typename T>
friend inline 1687 string.pData->buffer,
string.pData->length)
1691 template<
typename T>
friend inline 1696 string.pData->buffer,
string.pData->length,
1703 template<
typename T>
friend inline 1711 string.pData->buffer,
string.pData->length)
1716 #if defined LIBO_INTERNAL_ONLY 1735 lhs.pData->buffer, lhs.pData->length, rhs.data))
1739 friend bool operator <=(
OUString const & lhs, OUStringLiteral
const & rhs) {
1742 lhs.pData->buffer, lhs.pData->length, rhs.data))
1749 lhs.pData->buffer, lhs.pData->length, rhs.data))
1753 friend bool operator >=(
OUString const & lhs, OUStringLiteral
const & rhs) {
1756 lhs.pData->buffer, lhs.pData->length, rhs.data))
1771 rhs.pData->buffer, rhs.pData->length, lhs.data))
1775 friend bool operator <=(OUStringLiteral
const & lhs,
OUString const & rhs) {
1778 rhs.pData->buffer, rhs.pData->length, lhs.data))
1785 rhs.pData->buffer, rhs.pData->length, lhs.data))
1789 friend bool operator >=(OUStringLiteral
const & lhs,
OUString const & rhs) {
1792 rhs.pData->buffer, rhs.pData->length, lhs.data))
1827 return (ret < 0 ? ret : ret+fromIndex);
1879 str.pData->buffer, str.pData->length );
1880 return (ret < 0 ? ret : ret+fromIndex);
1888 template<
typename T >
1894 pData->buffer + fromIndex, pData->length - fromIndex,
1897 return n < 0 ? n : n + fromIndex;
1900 #if defined LIBO_INTERNAL_ONLY 1902 template<
typename T>
1905 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
1906 assert(fromIndex >= 0);
1908 pData->buffer + fromIndex, pData->length - fromIndex,
1911 return n < 0 ? n : n + fromIndex;
1939 char const * str, sal_Int32 len, sal_Int32 fromIndex = 0)
const 1942 pData->buffer + fromIndex, pData->length - fromIndex, str, len);
1943 return ret < 0 ? ret : ret + fromIndex;
1950 #if SAL_TYPES_SIZEOFLONG == 8 1972 str.pData->buffer, str.pData->length );
1995 str.pData->buffer, str.pData->length );
2003 template<
typename T >
2009 pData->buffer, pData->length,
2014 #if defined LIBO_INTERNAL_ONLY 2016 template<
typename T>
2019 lastIndexOf(T & literal)
const {
2021 pData->buffer, pData->length,
2049 pData->buffer, pData->length, str, len);
2064 rtl_uString *pNew = NULL;
2083 rtl_uString *pNew = NULL;
2098 rtl_uString* pNew = NULL;
2103 #ifndef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 2106 return rStr1.
concat( rStr2 );
2125 rtl_uString* pNew = NULL;
2145 rtl_uString* pNew = NULL;
2169 OUString const & from,
OUString const & to, sal_Int32 * index = NULL)
const 2171 rtl_uString * s = NULL;
2174 &s, pData, from.pData, to.pData, index == NULL ? &i : index);
2196 template<
typename T >
2198 sal_Int32 * index = NULL)
const 2201 rtl_uString * s = NULL;
2207 index == NULL ? &i : index);
2229 template<
typename T >
2231 sal_Int32 * index = NULL)
const 2234 rtl_uString * s = NULL;
2237 &s, pData, from.pData,
2240 index == NULL ? &i : index);
2262 template<
typename T1,
typename T2 >
2268 rtl_uString * s = NULL;
2276 index == NULL ? &i : index);
2280 #if defined LIBO_INTERNAL_ONLY 2285 replaceFirst(T & from,
OUString const & to, sal_Int32 * index =
nullptr)
2288 rtl_uString * s =
nullptr;
2294 to.pData->buffer, to.pData->length, index ==
nullptr ? &i : index);
2296 throw std::bad_alloc();
2305 replaceFirst(
OUString const & from, T & to, sal_Int32 * index =
nullptr)
2308 rtl_uString * s =
nullptr;
2311 &s, pData, from.pData->buffer, from.pData->length,
2314 index ==
nullptr ? &i : index);
2316 throw std::bad_alloc();
2329 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2330 rtl_uString * s =
nullptr;
2338 index ==
nullptr ? &i : index);
2340 throw std::bad_alloc();
2353 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2354 rtl_uString * s =
nullptr;
2362 index ==
nullptr ? &i : index);
2364 throw std::bad_alloc();
2377 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2378 rtl_uString * s =
nullptr;
2386 index ==
nullptr ? &i : index);
2388 throw std::bad_alloc();
2413 rtl_uString * s = NULL;
2431 template<
typename T >
2435 rtl_uString * s = NULL;
2456 template<
typename T >
2460 rtl_uString * s = NULL;
2462 &s, pData, from.pData,
2481 template<
typename T1,
typename T2 >
2487 rtl_uString * s = NULL;
2497 #if defined LIBO_INTERNAL_ONLY 2502 replaceAll(T & from,
OUString const & to)
const {
2503 rtl_uString * s =
nullptr;
2508 to.pData->buffer, to.pData->length);
2510 throw std::bad_alloc();
2519 replaceAll(
OUString const & from, T & to)
const {
2520 rtl_uString * s =
nullptr;
2522 &s, pData, from.pData->buffer, from.pData->length,
2526 throw std::bad_alloc();
2539 replaceAll(T1 & from, T2 & to)
const {
2540 rtl_uString * s =
nullptr;
2548 throw std::bad_alloc();
2561 replaceAll(T1 & from, T2 & to)
const {
2562 rtl_uString * s =
nullptr;
2570 throw std::bad_alloc();
2583 replaceAll(T1 & from, T2 & to)
const {
2584 rtl_uString * s =
nullptr;
2592 throw std::bad_alloc();
2611 rtl_uString* pNew = NULL;
2628 rtl_uString* pNew = NULL;
2646 rtl_uString* pNew = NULL;
2677 rtl_uString * pNew = NULL;
2697 return getToken(count, separator, n);
2721 return pData->buffer[0];
2832 rtl_uString * pNew = NULL;
2835 throw std::bad_alloc();
2868 sal_uInt32 *pInfo = NULL )
2870 rtl_uString * pNew = NULL;
2872 convertFlags, pInfo );
2874 throw std::bad_alloc();
2904 sal_uInt32 nFlags)
const 2907 pData->length, nEncoding, nFlags);
2962 sal_Int32 * indexUtf16, sal_Int32 incrementCodePoints = 1)
const 2965 pData, indexUtf16, incrementCodePoints);
3026 rtl_uString* pNewData = NULL;
3034 return number( static_cast< unsigned long long >( i ), radix );
3040 return number( static_cast< long long >( i ), radix );
3046 return number( static_cast< unsigned long long >( i ), radix );
3053 rtl_uString* pNewData = NULL;
3062 rtl_uString* pNewData = NULL;
3079 rtl_uString* pNewData = NULL;
3096 rtl_uString* pNewData = NULL;
3131 rtl_uString* pNewData = NULL;
3160 return number( i, radix );
3175 return number( ll, radix );
3223 rtl_uString* pNew = NULL;
3229 #if defined LIBO_INTERNAL_ONLY 3241 #if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 3248 struct ToStringHelper< OUString >
3250 static int length(
const OUString& s ) {
return s.
getLength(); }
3252 static const bool allowOStringConcat =
false;
3253 static const bool allowOUStringConcat =
true;
3260 struct ToStringHelper< OUStringLiteral >
3262 static int length(
const OUStringLiteral& str ) {
return str.size; }
3263 static sal_Unicode* addData(
sal_Unicode* buffer,
const OUStringLiteral& str ) {
return addDataLiteral( buffer, str.data, str.size ); }
3264 static const bool allowOStringConcat =
false;
3265 static const bool allowOUStringConcat =
true;
3271 template<
typename charT,
typename traits,
typename T1,
typename T2 >
3272 inline std::basic_ostream<charT, traits> &
operator <<(
3273 std::basic_ostream<charT, traits> & stream,
const OUStringConcat< T1, T2 >& concat)
3275 return stream << OUString( concat );
3298 {
return (
size_t)rString.
hashCode(); }
3324 return OUString( rStr.
getStr(), rStr.
getLength(), encoding, convertFlags );
3361 template<
typename charT,
typename traits >
3363 std::basic_ostream<charT, traits> & stream, OUString
const & rString)
3373 #ifdef RTL_STRING_UNITTEST 3376 typedef rtlunittest::OUString
OUString;
3383 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST 3384 using ::rtl::OUString;
3385 using ::rtl::OUStringHash;
3388 using ::rtl::OUStringLiteral;
3389 using ::rtl::OUStringLiteral1;
sal_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the end.
Definition: ustring.hxx:1969
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.
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...
#define OUSTRING_TO_OSTRING_CVTFLAGS
Definition: string.h:1324
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.
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type matchIgnoreAsciiCase(T &literal, sal_Int32 fromIndex=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:921
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...
static OUString createFromAscii(const sal_Char *value)
Returns a OUString copied without conversion from an ASCII character string.
Definition: ustring.hxx:3221
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_Int32 lastIndexOfAsciiL(char const *str, sal_Int32 len) const
Returns the index within this string of the last occurrence of the specified ASCII substring...
Definition: ustring.hxx:2046
sal_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition: textenc.h:39
bool isEmpty() const
Checks if a string is empty.
Definition: ustring.hxx:616
static OUString number(unsigned long i, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:3044
bool equalsAscii(const sal_Char *asciiStr) const
Perform a comparison of two strings.
Definition: ustring.hxx:1042
#define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
Definition: textcvt.h:64
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 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 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 void rtl_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
sal_Int32 toInt32(sal_Int16 radix=10) const
Returns the int32 value from this string.
Definition: ustring.hxx:2734
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_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 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...
#define RTL_STR_MAX_VALUEOFUINT64
Definition: string.h:673
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_WARN_UNUSED_RESULT OUString copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string that is a substring of this string.
Definition: ustring.hxx:2081
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.
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWithIgnoreAsciiCase(T &literal, OUString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:1330
Definition: stringutils.hxx:158
#define RTL_STR_MAX_VALUEOFINT64
Definition: string.h:650
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.
bool matchIgnoreAsciiCaseAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string, ignoring the case of ASCII letters.
Definition: ustring.hxx:1207
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...
void clear()
Clears the string, i.e, makes a zero-character string.
Definition: ustring.hxx:593
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfFloat(sal_Unicode *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
OUString intern() const
Return a canonical representation for a string.
Definition: ustring.hxx:2830
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_Int32 compareToIgnoreAsciiCaseAscii(const sal_Char *asciiStr) const
Compares two ASCII strings ignoring case.
Definition: ustring.hxx:1115
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_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.
static OUString number(double d)
Returns the string representation of the double argument.
Definition: ustring.hxx:3093
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 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.
static OUString number(unsigned long long ll, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:3059
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1656
OUString(rtl_uString *str)
New string from OUString data.
Definition: ustring.hxx:155
#define RTL_USTR_MAX_VALUEOFINT32
Definition: ustring.h:957
SAL_DLLPUBLIC double rtl_ustr_toDouble(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a double.
sal_Int32 indexOf(const OUString &str, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
Definition: ustring.hxx:1876
const sal_Char * getStr() const
Returns a pointer to the characters of this string.
Definition: string.hxx:430
bool convertToString(OString *pTarget, rtl_TextEncoding nEncoding, sal_uInt32 nFlags) const
Converts to an OString, signalling failure.
Definition: ustring.hxx:2903
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_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...
double toDouble() const
Returns the double value from this string.
Definition: ustring.hxx:2809
bool toBoolean() const
Returns the Boolean value from this string.
Definition: ustring.hxx:2708
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.
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1640
sal_Int32 hashCode() const
Returns a hashcode for this string.
Definition: ustring.hxx:1806
bool equals(const OUString &str) const
Perform a comparison of two strings.
Definition: ustring.hxx:742
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWith(T &literal, OUString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:1250
SAL_WARN_UNUSED_RESULT OUString replaceAll(OUString const &from, OUString const &to, sal_Int32 fromIndex=0) const
Returns a new string resulting from replacing all occurrences of a given substring with another subst...
Definition: ustring.hxx:2410
#define RTL_TEXTENCODING_UTF8
Definition: textenc.h:121
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type match(T &literal, sal_Int32 fromIndex=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:860
#define RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
Definition: textcvt.h:71
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.
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:509
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:624
bool matchAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition: ustring.hxx:1169
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.
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type equalsIgnoreAsciiCase(T &literal) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:804
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.
#define RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
Definition: textcvt.h:134
libreoffice_internal::ConstCharArrayDetector< T, sal_Int32 >::Type reverseCompareTo(T &literal) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:708
sal_Int32 compareTo(const OUString &str, sal_Int32 maxLength) const
Compares two strings with a maximum count of characters.
Definition: ustring.hxx:678
static OUString fromUtf8(const OString &rSource)
Convert an OString to an OUString, assuming that the OString is UTF-8-encoded.
Definition: ustring.hxx:2977
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.
#define RTL_USTR_MAX_VALUEOFBOOLEAN
Definition: ustring.h:915
sal_Int32 indexOfAsciiL(char const *str, sal_Int32 len, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified ASCII substring...
Definition: ustring.hxx:1938
OUString(rtl_uString *str, __sal_NoAcquire)
New OUString from OUString data without acquiring it.
Definition: ustring.hxx:169
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfDouble(sal_Unicode *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
static OUString number(float f)
Returns the string representation of the float argument.
Definition: ustring.hxx:3076
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_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceAll(T &from, OUString const &to) const
Returns a new string resulting from replacing all occurrences of a given substring with another subst...
Definition: ustring.hxx:2432
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1608
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...
bool equalsIgnoreAsciiCaseAscii(const sal_Char *asciiStr) const
Perform a ASCII lowercase comparison of two strings.
Definition: ustring.hxx:1092
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.
OUString(const OUString &str)
New string from OUString.
Definition: ustring.hxx:127
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...
This String class provide base functionality for C++ like 8-Bit character array handling.
Definition: string.hxx:90
SAL_WARN_UNUSED_RESULT OUString trim() const
Returns a new string resulting from removing white space from both ends of the string.
Definition: ustring.hxx:2644
sal_Int64 toInt64(sal_Int16 radix=10) const
Returns the int64 value from this string.
Definition: ustring.hxx:2766
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.
bool operator<(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:96
sal_uInt16 sal_Unicode
Definition: types.h:155
sal_Int32 compareTo(const OUString &str) const
Compares two strings.
Definition: ustring.hxx:657
bool matchIgnoreAsciiCase(const OUString &str, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string, ignoring the case of ASCII letters.
Definition: ustring.hxx:908
bool equalsIgnoreAsciiCase(const OUString &str) const
Perform a ASCII lowercase comparison of two strings.
Definition: ustring.hxx:766
bool match(const OUString &str, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition: ustring.hxx:848
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceFirst(OUString const &from, T &to, sal_Int32 *index=NULL) const
Returns a new string resulting from replacing the first occurrence of a given substring with another ...
Definition: ustring.hxx:2230
SAL_DLLPUBLIC void rtl_uString_intern(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Return a canonical representation for a string.
#define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
Definition: textcvt.h:128
unsigned char sal_Bool
Definition: types.h:48
libreoffice_internal::ConstCharArrayDetector< T, sal_Int32 >::Type lastIndexOf(T &literal) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:2004
__sal_NoAcquire
Definition: types.h:384
sal_Int32 compareToIgnoreAsciiCase(const OUString &str) const
Perform a ASCII lowercase comparison of two strings.
Definition: ustring.hxx:791
static OUString number(int i, sal_Int16 radix=10)
Returns the string representation of the integer argument.
Definition: ustring.hxx:3023
bool startsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string starts with a given substring.
Definition: ustring.hxx:1236
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1624
OUString getToken(sal_Int32 token, sal_Unicode cTok, sal_Int32 &index) const
Returns a token in the string.
Definition: ustring.hxx:2675
libreoffice_internal::ConstCharArrayDetector< T, OUString &>::Type operator=(T &literal)
Assign a new string from an 8-Bit string literal that is expected to contain only characters in the A...
Definition: ustring.hxx:459
#define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
Definition: textcvt.h:68
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...
bool endsWithAsciiL(char const *asciiStr, sal_Int32 asciiStrLength) const
Check whether this string ends with a given ASCII string.
Definition: ustring.hxx:1461
bool equalsIgnoreAsciiCaseAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:1140
SAL_WARN_UNUSED_RESULT OUString toAsciiLowerCase() const
Converts from this string all ASCII uppercase characters (65-90) to ASCII lowercase characters (97-12...
Definition: ustring.hxx:2609
sal_Int32 compareToAscii(const sal_Char *asciiStr) const
Compares two strings.
Definition: ustring.hxx:967
static OUString boolean(bool b)
Returns the string representation of the boolean argument.
Definition: ustring.hxx:3128
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_compare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Unicode *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings.
static OUString number(long i, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:3038
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceAll(OUString const &from, T &to) const
Returns a new string resulting from replacing all occurrences of a given substring with another subst...
Definition: ustring.hxx:2457
OUString(sal_uInt32 const *codePoints, sal_Int32 codePointCount)
Create a new string from an array of Unicode code points.
Definition: ustring.hxx:364
SAL_WARN_UNUSED_RESULT OUString replaceAt(sal_Int32 index, sal_Int32 count, const OUString &newStr) const
Returns a new string resulting from replacing n = count characters from position index in this string...
Definition: ustring.hxx:2123
OUString(const sal_Unicode *value, sal_Int32 length)
New string from a Unicode character buffer array.
Definition: ustring.hxx:213
sal_Int32 reverseCompareTo(const OUString &str) const
Compares two strings in reverse order.
Definition: ustring.hxx:696
bool operator==(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:116
OUString & operator=(const OUString &str)
Assign a new string.
Definition: ustring.hxx:421
OString OUStringToOString(const OUString &rUnicode, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OUSTRING_TO_OSTRING_CVTFLAGS)
Convert an OUString to an OString, using a specific text encoding.
Definition: ustring.hxx:3344
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_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...
OUString(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
New string from an 8-Bit string literal that is expected to contain only characters in the ASCII set ...
Definition: ustring.hxx:235
sal_Int32 lastIndexOf(sal_Unicode ch, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified character, searching backward starting before the specified index.
Definition: ustring.hxx:1856
bool endsWithIgnoreAsciiCaseAsciiL(char const *asciiStr, sal_Int32 asciiStrLength) const
Check whether this string ends with a given ASCII string, ignoring the case of ASCII letters...
Definition: ustring.hxx:1567
sal_Int32 lastIndexOf(const OUString &str, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified substring, searching backward starting before the specified index.
Definition: ustring.hxx:1992
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T1, typename libreoffice_internal::ConstCharArrayDetector< T2, OUString >::Type >::Type replaceFirst(T1 &from, T2 &to, sal_Int32 *index=NULL) const
Returns a new string resulting from replacing the first occurrence of a given substring with another ...
Definition: ustring.hxx:2264
bool operator!=(const Any &rAny, const C &value)
Template unequality operator: compares set value of left side any to right side value.
Definition: Any.hxx:633
definition of a no acquire enum for ctors
Definition: types.h:388
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.
size_t operator()(const OUString &rString) const
Compute a hash code for a string.
Definition: ustring.hxx:3297
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 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_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T1, typename libreoffice_internal::ConstCharArrayDetector< T2, OUString >::Type >::Type replaceAll(T1 &from, T2 &to) const
Returns a new string resulting from replacing all occurrences of a given substring with another subst...
Definition: ustring.hxx:2483
bool endsWithIgnoreAsciiCase(OUString const &str, OUString *rest=NULL) const
Check whether this string ends with a given string, ignoring the case of ASCII letters.
Definition: ustring.hxx:1490
bool endsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string ends with a given substring.
Definition: ustring.hxx:1386
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type endsWith(T &literal, OUString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:1402
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_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_uInt64 toUInt64(sal_Int16 radix=10) const
Returns the uint64 value from this string.
Definition: ustring.hxx:2783
float toFloat() const
Returns the float value from this string.
Definition: ustring.hxx:2796
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:106
SAL_WARN_UNUSED_RESULT OUString copy(sal_Int32 beginIndex) const
Returns a new string that is a substring of this string.
Definition: ustring.hxx:2062
OUString(const sal_Char *value, sal_Int32 length, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OSTRING_TO_OUSTRING_CVTFLAGS)
New string from an 8-Bit character buffer array.
Definition: ustring.hxx:337
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 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.
SAL_WARN_UNUSED_RESULT OUString replace(sal_Unicode oldChar, sal_Unicode newChar) const
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar...
Definition: ustring.hxx:2143
static OUString intern(const sal_Char *value, sal_Int32 length, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OSTRING_TO_OUSTRING_CVTFLAGS, sal_uInt32 *pInfo=NULL)
Return a canonical representation for a converted string.
Definition: ustring.hxx:2865
sal_Int32 reverseCompareToAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Compares two strings in reverse order.
Definition: ustring.hxx:1021
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, OString const &rString)
Support for rtl::OString in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO macros, for example).
Definition: string.hxx:1894
#define SAL_CONSTEXPR
C++11 "constexpr" feature.
Definition: types.h:445
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:325
char sal_Char
A legacy synonym for char.
Definition: types.h:130
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:499
OUString OStringToOUString(const OString &rStr, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OSTRING_TO_OUSTRING_CVTFLAGS)
Convert an OString to an OUString, using a specific text encoding.
Definition: ustring.hxx:3320
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition: ustring.h:1022
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const sal_Char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
libreoffice_internal::ConstCharArrayDetector< T, sal_Int32 >::Type indexOf(T &literal, sal_Int32 fromIndex=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:1889
bool operator>(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:106
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_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceFirst(T &from, OUString const &to, sal_Int32 *index=NULL) const
Returns a new string resulting from replacing the first occurrence of a given substring with another ...
Definition: ustring.hxx:2197
SAL_WARN_UNUSED_RESULT OUString replaceFirst(OUString const &from, OUString const &to, sal_Int32 *index=NULL) const
Returns a new string resulting from replacing the first occurrence of a given substring with another ...
Definition: ustring.hxx:2168
SAL_WARN_UNUSED_RESULT OUString toAsciiUpperCase() const
Converts from this string all ASCII lowercase characters (97-122) to ASCII uppercase characters (65-9...
Definition: ustring.hxx:2626
OUString getToken(sal_Int32 count, sal_Unicode separator) const
Returns a token from the string.
Definition: ustring.hxx:2695
OUString(sal_Unicode value)
New string from a single Unicode character.
Definition: ustring.hxx:177
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition: ustring.h:1041
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_Unicode toChar() const
Returns the first character from this string.
Definition: ustring.hxx:2719
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.
Definition: stringutils.hxx:115
OUString(const sal_Unicode *value)
New string from a Unicode character buffer array.
Definition: ustring.hxx:199
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.
const sal_Unicode * getStr() const
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:628
bool equalsAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Perform a comparison of two strings.
Definition: ustring.hxx:1065
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.
sal_Int32 indexOf(sal_Unicode ch, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.
Definition: ustring.hxx:1824
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_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_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character, searching backward starting at the end.
Definition: ustring.hxx:1839
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.
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.
sal_Int32 getLength() const
Returns the length of this string.
Definition: string.hxx:404
static OUString const & unacquired(rtl_uString *const *ppHandle)
Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
Definition: ustring.hxx:413
Definition: bootstrap.hxx:29
SAL_WARN_UNUSED_RESULT OUString concat(const OUString &str) const
Concatenates the specified string to the end of this string.
Definition: ustring.hxx:2096
bool startsWithIgnoreAsciiCase(OUString const &str, OUString *rest=NULL) const
Check whether this string starts with a given string, ignoring the case of ASCII letters.
Definition: ustring.hxx:1313
friend OUString operator+(const OUString &rStr1, const OUString &rStr2)
Definition: ustring.hxx:2104
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 void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
OUString()
New string containing no characters.
Definition: ustring.hxx:116
sal_uInt32 iterateCodePoints(sal_Int32 *indexUtf16, sal_Int32 incrementCodePoints=1) const
Iterate through this string based on code points instead of UTF-16 code units.
Definition: ustring.hxx:2961
sal_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:606
SAL_DLLPUBLIC sal_Int32 rtl_ustr_toInt32(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an integer.
static OUString number(unsigned int i, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:3032
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.
#define OSTRING_TO_OUSTRING_CVTFLAGS
Definition: ustring.h:2117
sal_uInt32 toUInt32(sal_Int16 radix=10) const
Returns the uint32 value from this string.
Definition: ustring.hxx:2751
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.
static OUString number(long long ll, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:3050
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_assign(rtl_uString **str, rtl_uString *rightValue) SAL_THROW_EXTERN_C()
Assign a new value to a string.
SAL_DLLPUBLIC float rtl_ustr_toFloat(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a float.
A helper to use OUStrings with hash maps.
Definition: ustring.hxx:3286
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_DLLPUBLIC void rtl_uString_acquire(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Increment the reference count of a string.
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type endsWithIgnoreAsciiCase(T &literal, OUString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:1507
~OUString()
Release the string data.
Definition: ustring.hxx:397
OString toUtf8() const
Convert this string to an OString, assuming that the string can be UTF-8-encoded successfully.
Definition: ustring.hxx:3000
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 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.
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.