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> 42 #ifdef RTL_STRING_UNITTEST 43 extern bool rtl_string_unittest_invalid_conversion;
51 #ifdef RTL_STRING_UNITTEST 52 #define rtl rtlunittest 58 #ifdef RTL_STRING_UNITTEST 62 #if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 73 template<
typename T> constexpr OUStringLiteral(
75 typename libreoffice_internal::ConstCharArrayDetector<
76 T, libreoffice_internal::Dummy>::Type
77 = libreoffice_internal::Dummy()):
78 size(libreoffice_internal::ConstCharArrayDetector<T>::length),
80 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal))
82 #if HAVE_CXX14_CONSTEXPR 84 libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal));
147 #ifndef _MSC_VER // TODO? 148 #if defined LIBO_INTERNAL_ONLY 197 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST_CONCAT 248 template<
typename T >
263 #ifdef RTL_STRING_UNITTEST 264 rtl_string_unittest_const_literal =
true;
268 #if defined LIBO_INTERNAL_ONLY 289 #ifdef RTL_STRING_UNITTEST 294 template<
typename T >
299 rtl_string_unittest_invalid_conversion =
true;
305 template<
typename T >
310 rtl_string_unittest_invalid_conversion =
true;
314 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 331 OUString(OUStringLiteral literal): pData(NULL) {
358 throw std::bad_alloc();
379 sal_uInt32
const * codePoints, sal_Int32 codePointCount):
384 throw std::bad_alloc();
388 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 393 template<
typename T1,
typename T2 >
394 OUString(
const OUStringConcat< T1, T2 >& c )
396 const sal_Int32 l = c.length();
428 {
return *
reinterpret_cast< OUString const *
>( ppHandle ); }
441 #ifndef _MSC_VER // TODO? 442 #if defined LIBO_INTERNAL_ONLY 472 template<
typename T >
489 #if defined LIBO_INTERNAL_ONLY 494 operator =(T & literal) {
508 OUString & operator =(OUStringLiteral
const & literal) {
509 if (literal.size == 0) {
524 #if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER 531 #if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER 532 void operator+=(
OUString const &) && =
delete;
543 operator +=(T & literal)
544 #if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER 556 #if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER 559 operator +=(T &) && =
delete;
562 #if defined LIBO_INTERNAL_ONLY 567 operator +=(T & literal)
568 #if HAVE_CXX11_REF_QUALIFIER 578 #if HAVE_CXX11_REF_QUALIFIER 582 operator +=(T &) && =
delete;
586 OUString & operator +=(OUStringLiteral
const & literal)
587 #if HAVE_CXX11_REF_QUALIFIER 594 #if HAVE_CXX11_REF_QUALIFIER 595 void operator +=(OUStringLiteral
const &) && =
delete;
599 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 604 template<
typename T1,
typename T2 >
605 OUString& operator+=(
const OUStringConcat< T1, T2 >& c )
606 #if HAVE_CXX11_REF_QUALIFIER 610 sal_Int32 l = c.length();
615 sal_Unicode* end = c.addData( pData->buffer + pData->length );
620 #if HAVE_CXX11_REF_QUALIFIER 621 template<
typename T1,
typename T2>
void operator +=(
622 OUStringConcat<T1, T2>
const &) && =
delete;
655 return pData->length == 0;
678 assert(index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength()));
679 return getStr()[index];
697 str.pData->buffer, str.pData->length );
718 str.pData->buffer, str.pData->length, maxLength );
736 str.pData->buffer, str.pData->length );
744 template<
typename T >
750 pData->buffer, pData->length,
755 #if defined LIBO_INTERNAL_ONLY 760 reverseCompareTo(T & literal)
const {
762 pData->buffer, pData->length,
768 sal_Int32 reverseCompareTo(OUStringLiteral
const & literal)
const {
770 pData->buffer, pData->length, literal.data, literal.size);
787 if ( pData->length != str.pData->length )
789 if ( pData == str.pData )
792 str.pData->buffer, str.pData->length ) == 0;
811 if ( pData->length != str.pData->length )
813 if ( pData == str.pData )
816 str.pData->buffer, str.pData->length ) == 0;
837 str.pData->buffer, str.pData->length );
846 template<
typename T >
855 pData->buffer, pData->length,
861 #if defined LIBO_INTERNAL_ONLY 865 equalsIgnoreAsciiCase(T & literal)
const {
868 pData->buffer, pData->length,
876 bool equalsIgnoreAsciiCase(OUStringLiteral
const & literal)
const {
877 return pData->length == literal.size
879 pData->buffer, pData->length, literal.data)
902 str.pData->buffer, str.pData->length, str.pData->length ) == 0;
910 template<
typename T >
917 pData->buffer+fromIndex, pData->length-fromIndex,
924 #if defined LIBO_INTERNAL_ONLY 928 match(T & literal, sal_Int32 fromIndex = 0)
const {
929 assert(fromIndex >= 0);
932 pData->buffer + fromIndex, pData->length - fromIndex,
941 bool match(OUStringLiteral
const & literal, sal_Int32 fromIndex = 0)
const {
944 pData->buffer + fromIndex, pData->length - fromIndex,
945 literal.data, literal.size)
971 str.pData->buffer, str.pData->length,
972 str.pData->length ) == 0;
980 template<
typename T >
987 pData->buffer+fromIndex, pData->length-fromIndex,
994 #if defined LIBO_INTERNAL_ONLY 998 matchIgnoreAsciiCase(T & literal, sal_Int32 fromIndex = 0)
const {
999 assert(fromIndex >= 0);
1002 pData->buffer + fromIndex, pData->length - fromIndex,
1011 bool matchIgnoreAsciiCase(
1012 OUStringLiteral
const & literal, sal_Int32 fromIndex = 0)
const 1016 pData->buffer+fromIndex, pData->length-fromIndex, literal.data,
1066 "replace s1.compareToAscii(s2, strlen(s2)) == 0 with s1.startsWith(s2)")
1067 sal_Int32 compareToAscii( const
sal_Char * asciiStr, sal_Int32 maxLength )
const 1070 asciiStr, maxLength );
1095 asciiStr, asciiStrLength );
1138 if ( pData->length != asciiStrLength )
1142 pData->buffer, asciiStr, asciiStrLength );
1213 if ( pData->length != asciiStrLength )
1243 asciiStr, asciiStrLength ) == 0;
1250 #if SAL_TYPES_SIZEOFLONG == 8 1281 asciiStr, asciiStrLength ) == 0;
1288 #if SAL_TYPES_SIZEOFLONG == 8 1308 bool b = match(str);
1309 if (b && rest != NULL) {
1320 template<
typename T >
1322 T & literal,
OUString * rest = NULL)
const 1328 <= sal_uInt32(pData->length))
1334 if (b && rest != NULL) {
1341 #if defined LIBO_INTERNAL_ONLY 1343 template<
typename T>
1345 startsWith(T & literal,
OUString * rest =
nullptr)
const {
1348 <= sal_uInt32(pData->length))
1356 if (b && rest !=
nullptr) {
1364 bool startsWith(OUStringLiteral
const & literal,
OUString * rest =
nullptr)
1367 bool b = literal.size <= pData->length
1369 pData->buffer, literal.data, literal.size);
1370 if (b && rest !=
nullptr) {
1371 *rest = copy(literal.size);
1400 bool b = matchIgnoreAsciiCase(str);
1401 if (b && rest != NULL) {
1412 template<
typename T >
1426 if (b && rest != NULL) {
1433 #if defined LIBO_INTERNAL_ONLY 1435 template<
typename T>
1437 startsWithIgnoreAsciiCase(T & literal,
OUString * rest =
nullptr)
const {
1440 <= sal_uInt32(pData->length))
1448 if (b && rest !=
nullptr) {
1456 bool startsWithIgnoreAsciiCase(
1457 OUStringLiteral
const & literal,
OUString * rest =
nullptr)
const 1461 pData->buffer, literal.size, literal.data, literal.size)
1463 if (b && rest !=
nullptr) {
1464 *rest = copy(literal.size);
1486 && match(str, getLength() - str.
getLength());
1487 if (b && rest != NULL) {
1488 *rest = copy(0, getLength() - str.
getLength());
1498 template<
typename T >
1506 <= sal_uInt32(pData->length))
1508 (pData->buffer + pData->length
1513 if (b && rest != NULL) {
1522 #if defined LIBO_INTERNAL_ONLY 1524 template<
typename T>
1526 endsWith(T & literal,
OUString * rest =
nullptr)
const {
1529 <= sal_uInt32(pData->length))
1531 (pData->buffer + pData->length
1538 if (b && rest !=
nullptr) {
1548 bool endsWith(OUStringLiteral
const & literal,
OUString * rest =
nullptr)
1551 bool b = literal.size <= pData->length
1553 pData->buffer + pData->length - literal.size,
1554 literal.data, literal.size);
1555 if (b && rest !=
nullptr) {
1556 *rest = copy(0, (getLength() - literal.size));
1576 return asciiStrLength <= pData->length
1578 pData->buffer + pData->length - asciiStrLength, asciiStr,
1605 && matchIgnoreAsciiCase(str, getLength() - str.
getLength());
1606 if (b && rest != NULL) {
1607 *rest = copy(0, getLength() - str.
getLength());
1617 template<
typename T >
1625 <= sal_uInt32(pData->length))
1627 (pData->buffer + pData->length
1634 if (b && rest != NULL) {
1643 #if defined LIBO_INTERNAL_ONLY 1645 template<
typename T>
1647 endsWithIgnoreAsciiCase(T & literal,
OUString * rest =
nullptr)
const {
1650 <= sal_uInt32(pData->length))
1652 (pData->buffer + pData->length
1659 if (b && rest !=
nullptr) {
1669 bool endsWithIgnoreAsciiCase(
1670 OUStringLiteral
const & literal,
OUString * rest =
nullptr)
const 1672 bool b = literal.size <= pData->length
1674 pData->buffer + pData->length - literal.size,
1675 literal.size, literal.data, literal.size)
1677 if (b && rest !=
nullptr) {
1678 *rest = copy(0, getLength() - literal.size);
1695 char const * asciiStr, sal_Int32 asciiStrLength)
const 1697 return asciiStrLength <= pData->length
1699 pData->buffer + pData->length - asciiStrLength,
1700 asciiStrLength, asciiStr, asciiStrLength)
1705 {
return rStr1.
equals(rStr2); }
1707 {
return rStr1.
compareTo( pStr2 ) == 0; }
1719 {
return rStr1.
compareTo( rStr2 ) < 0; }
1721 {
return rStr1.
compareTo( rStr2 ) > 0; }
1723 {
return rStr1.
compareTo( rStr2 ) <= 0; }
1725 {
return rStr1.
compareTo( rStr2 ) >= 0; }
1734 template<
typename T >
1750 template<
typename T >
1766 template<
typename T >
1782 template<
typename T >
1792 #if defined LIBO_INTERNAL_ONLY 1798 string.pData->buffer,
string.pData->length,
1812 string.pData->buffer,
string.pData->length)
1820 string.pData->buffer,
string.pData->length,
1834 string.pData->buffer,
string.pData->length)
1839 #if defined LIBO_INTERNAL_ONLY 1858 lhs.pData->buffer, lhs.pData->length, rhs.data))
1862 friend bool operator <=(
OUString const & lhs, OUStringLiteral
const & rhs) {
1865 lhs.pData->buffer, lhs.pData->length, rhs.data))
1872 lhs.pData->buffer, lhs.pData->length, rhs.data))
1876 friend bool operator >=(
OUString const & lhs, OUStringLiteral
const & rhs) {
1879 lhs.pData->buffer, lhs.pData->length, rhs.data))
1894 rhs.pData->buffer, rhs.pData->length, lhs.data))
1898 friend bool operator <=(OUStringLiteral
const & lhs,
OUString const & rhs) {
1901 rhs.pData->buffer, rhs.pData->length, lhs.data))
1908 rhs.pData->buffer, rhs.pData->length, lhs.data))
1912 friend bool operator >=(OUStringLiteral
const & lhs,
OUString const & rhs) {
1915 rhs.pData->buffer, rhs.pData->length, lhs.data))
1950 return (ret < 0 ? ret : ret+fromIndex);
2002 str.pData->buffer, str.pData->length );
2003 return (ret < 0 ? ret : ret+fromIndex);
2011 template<
typename T >
2017 pData->buffer + fromIndex, pData->length - fromIndex,
2020 return n < 0 ? n : n + fromIndex;
2023 #if defined LIBO_INTERNAL_ONLY 2025 template<
typename T>
2028 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
2029 assert(fromIndex >= 0);
2031 pData->buffer + fromIndex, pData->length - fromIndex,
2034 return n < 0 ? n : n + fromIndex;
2038 sal_Int32 indexOf(OUStringLiteral
const & literal, sal_Int32 fromIndex = 0)
2042 pData->buffer + fromIndex, pData->length - fromIndex, literal.data,
2044 return n < 0 ? n : n + fromIndex;
2072 char const * str, sal_Int32 len, sal_Int32 fromIndex = 0)
const 2075 pData->buffer + fromIndex, pData->length - fromIndex, str, len);
2076 return ret < 0 ? ret : ret + fromIndex;
2083 #if SAL_TYPES_SIZEOFLONG == 8 2105 str.pData->buffer, str.pData->length );
2128 str.pData->buffer, str.pData->length );
2136 template<
typename T >
2142 pData->buffer, pData->length,
2147 #if defined LIBO_INTERNAL_ONLY 2149 template<
typename T>
2152 lastIndexOf(T & literal)
const {
2154 pData->buffer, pData->length,
2160 sal_Int32 lastIndexOf(OUStringLiteral
const & literal)
const {
2162 pData->buffer, pData->length, literal.data, literal.size);
2188 pData->buffer, pData->length, str, len);
2203 rtl_uString *pNew = NULL;
2222 rtl_uString *pNew = NULL;
2237 rtl_uString* pNew = NULL;
2242 #ifndef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 2245 return rStr1.
concat( rStr2 );
2264 rtl_uString* pNew = NULL;
2284 rtl_uString* pNew = NULL;
2308 OUString const & from,
OUString const & to, sal_Int32 * index = NULL)
const 2310 rtl_uString * s = NULL;
2313 &s, pData, from.pData, to.pData, index == NULL ? &i : index);
2335 template<
typename T >
2337 sal_Int32 * index = NULL)
const 2340 rtl_uString * s = NULL;
2346 index == NULL ? &i : index);
2368 template<
typename T >
2370 sal_Int32 * index = NULL)
const 2373 rtl_uString * s = NULL;
2376 &s, pData, from.pData,
2379 index == NULL ? &i : index);
2401 template<
typename T1,
typename T2 >
2407 rtl_uString * s = NULL;
2415 index == NULL ? &i : index);
2419 #if defined LIBO_INTERNAL_ONLY 2424 replaceFirst(T & from,
OUString const & to, sal_Int32 * index =
nullptr)
2427 rtl_uString * s =
nullptr;
2433 to.pData->buffer, to.pData->length, index ==
nullptr ? &i : index);
2435 throw std::bad_alloc();
2444 replaceFirst(
OUString const & from, T & to, sal_Int32 * index =
nullptr)
2447 rtl_uString * s =
nullptr;
2450 &s, pData, from.pData->buffer, from.pData->length,
2453 index ==
nullptr ? &i : index);
2455 throw std::bad_alloc();
2468 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2469 rtl_uString * s =
nullptr;
2477 index ==
nullptr ? &i : index);
2479 throw std::bad_alloc();
2492 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2493 rtl_uString * s =
nullptr;
2501 index ==
nullptr ? &i : index);
2503 throw std::bad_alloc();
2516 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2517 rtl_uString * s =
nullptr;
2525 index ==
nullptr ? &i : index);
2527 throw std::bad_alloc();
2535 OUStringLiteral
const & from,
OUString const & to,
2536 sal_Int32 * index =
nullptr)
const 2538 rtl_uString * s =
nullptr;
2541 &s, pData, from.data, from.size, to.pData,
2542 index ==
nullptr ? &i : index);
2547 OUString const & from, OUStringLiteral
const & to,
2548 sal_Int32 * index =
nullptr)
const 2550 rtl_uString * s =
nullptr;
2553 &s, pData, from.pData, to.data, to.size,
2554 index ==
nullptr ? &i : index);
2559 OUStringLiteral
const & from, OUStringLiteral
const & to,
2560 sal_Int32 * index =
nullptr)
const 2562 rtl_uString * s =
nullptr;
2565 &s, pData, from.data, from.size, to.data, to.size,
2566 index ==
nullptr ? &i : index);
2573 OUStringLiteral
const & from, T & to, sal_Int32 * index =
nullptr)
const 2576 rtl_uString * s =
nullptr;
2579 &s, pData, from.data, from.size,
2582 index ==
nullptr ? &i : index);
2589 T & from, OUStringLiteral
const & to, sal_Int32 * index =
nullptr)
const 2592 rtl_uString * s =
nullptr;
2598 to.size, index ==
nullptr ? &i : index);
2606 OUStringLiteral
const & from, T & to, sal_Int32 * index =
nullptr)
const 2609 rtl_uString * s =
nullptr;
2612 &s, pData, from.data, from.size,
2615 index ==
nullptr ? &i : index);
2623 T & from, OUStringLiteral
const & to, sal_Int32 * index =
nullptr)
const 2626 rtl_uString * s =
nullptr;
2632 to.size, index ==
nullptr ? &i : index);
2655 rtl_uString * s = NULL;
2673 template<
typename T >
2677 rtl_uString * s = NULL;
2698 template<
typename T >
2702 rtl_uString * s = NULL;
2704 &s, pData, from.pData,
2723 template<
typename T1,
typename T2 >
2729 rtl_uString * s = NULL;
2739 #if defined LIBO_INTERNAL_ONLY 2744 replaceAll(T & from,
OUString const & to)
const {
2745 rtl_uString * s =
nullptr;
2750 to.pData->buffer, to.pData->length);
2752 throw std::bad_alloc();
2761 replaceAll(
OUString const & from, T & to)
const {
2762 rtl_uString * s =
nullptr;
2764 &s, pData, from.pData->buffer, from.pData->length,
2768 throw std::bad_alloc();
2781 replaceAll(T1 & from, T2 & to)
const {
2782 rtl_uString * s =
nullptr;
2790 throw std::bad_alloc();
2803 replaceAll(T1 & from, T2 & to)
const {
2804 rtl_uString * s =
nullptr;
2812 throw std::bad_alloc();
2825 replaceAll(T1 & from, T2 & to)
const {
2826 rtl_uString * s =
nullptr;
2834 throw std::bad_alloc();
2842 OUStringLiteral
const & from,
OUString const & to)
const 2844 rtl_uString * s =
nullptr;
2846 &s, pData, from.data, from.size, to.pData);
2851 OUString const & from, OUStringLiteral
const & to)
const 2853 rtl_uString * s =
nullptr;
2855 &s, pData, from.pData, to.data, to.size);
2860 OUStringLiteral
const & from, OUStringLiteral
const & to)
const 2862 rtl_uString * s =
nullptr;
2864 &s, pData, from.data, from.size, to.data, to.size);
2870 replaceAll(OUStringLiteral
const & from, T & to)
const {
2872 rtl_uString * s =
nullptr;
2874 &s, pData, from.data, from.size,
2882 replaceAll(T & from, OUStringLiteral
const & to)
const {
2884 rtl_uString * s =
nullptr;
2896 replaceAll(OUStringLiteral
const & from, T & to)
const {
2898 rtl_uString * s =
nullptr;
2900 &s, pData, from.data, from.size,
2909 replaceAll(T & from, OUStringLiteral
const & to)
const {
2911 rtl_uString * s =
nullptr;
2933 rtl_uString* pNew = NULL;
2950 rtl_uString* pNew = NULL;
2968 rtl_uString* pNew = NULL;
2999 rtl_uString * pNew = NULL;
3019 return getToken(count, separator, n);
3043 return pData->buffer[0];
3154 rtl_uString * pNew = NULL;
3157 throw std::bad_alloc();
3190 sal_uInt32 *pInfo = NULL )
3192 rtl_uString * pNew = NULL;
3194 convertFlags, pInfo );
3196 throw std::bad_alloc();
3226 sal_uInt32 nFlags)
const 3229 pData->length, nEncoding, nFlags);
3284 sal_Int32 * indexUtf16, sal_Int32 incrementCodePoints = 1)
const 3287 pData, indexUtf16, incrementCodePoints);
3348 rtl_uString* pNewData = NULL;
3356 return number( static_cast< unsigned long long >( i ), radix );
3362 return number( static_cast< long long >( i ), radix );
3368 return number( static_cast< unsigned long long >( i ), radix );
3375 rtl_uString* pNewData = NULL;
3384 rtl_uString* pNewData = NULL;
3401 rtl_uString* pNewData = NULL;
3418 rtl_uString* pNewData = NULL;
3453 rtl_uString* pNewData = NULL;
3482 return number( i, radix );
3497 return number( ll, radix );
3545 rtl_uString* pNew = NULL;
3551 #if defined LIBO_INTERNAL_ONLY 3563 #if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 3570 struct ToStringHelper< OUString >
3572 static int length(
const OUString& s ) {
return s.
getLength(); }
3574 static const bool allowOStringConcat =
false;
3575 static const bool allowOUStringConcat =
true;
3582 struct ToStringHelper< OUStringLiteral >
3584 static int length(
const OUStringLiteral& str ) {
return str.size; }
3585 static sal_Unicode* addData(
sal_Unicode* buffer,
const OUStringLiteral& str ) {
return addDataLiteral( buffer, str.data, str.size ); }
3586 static const bool allowOStringConcat =
false;
3587 static const bool allowOUStringConcat =
true;
3593 template<
typename charT,
typename traits,
typename T1,
typename T2 >
3594 inline std::basic_ostream<charT, traits> &
operator <<(
3595 std::basic_ostream<charT, traits> & stream,
const OUStringConcat< T1, T2 >& concat)
3597 return stream << OUString( concat );
3620 {
return (
size_t)rString.
hashCode(); }
3646 return OUString( rStr.
getStr(), rStr.
getLength(), encoding, convertFlags );
3683 template<
typename charT,
typename traits >
3685 std::basic_ostream<charT, traits> & stream, OUString
const & rString)
3695 #ifdef RTL_STRING_UNITTEST 3698 typedef rtlunittest::OUString
OUString;
3705 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST 3706 using ::rtl::OUString;
3707 using ::rtl::OUStringHash;
3710 using ::rtl::OUStringLiteral;
3711 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:2102
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:981
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:3543
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:2185
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:653
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:3366
bool equalsAscii(const sal_Char *asciiStr) const
Perform a comparison of two strings.
Definition: ustring.hxx:1113
#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:3056
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:2220
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:1414
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:1278
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:630
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:3152
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:1186
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:3415
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:3381
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1783
OUString(rtl_uString *str)
New string from OUString data.
Definition: ustring.hxx:169
#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:1999
const sal_Char * getStr() const
Returns a pointer to the characters of this string.
Definition: string.hxx:435
bool convertToString(OString *pTarget, rtl_TextEncoding nEncoding, sal_uInt32 nFlags) const
Converts to an OString, signalling failure.
Definition: ustring.hxx:3225
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:3131
bool toBoolean() const
Returns the Boolean value from this string.
Definition: ustring.hxx:3030
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:1767
sal_Int32 hashCode() const
Returns a hashcode for this string.
Definition: ustring.hxx:1929
bool equals(const OUString &str) const
Perform a comparison of two strings.
Definition: ustring.hxx:785
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:1321
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:2652
#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:911
#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:483
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:598
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:1240
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:847
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:745
sal_Int32 compareTo(const OUString &str, sal_Int32 maxLength) const
Compares two strings with a maximum count of characters.
Definition: ustring.hxx:715
static OUString fromUtf8(const OString &rSource)
Convert an OString to an OUString, assuming that the OString is UTF-8-encoded.
Definition: ustring.hxx:3299
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:2071
OUString(rtl_uString *str, __sal_NoAcquire)
New OUString from OUString data without acquiring it.
Definition: ustring.hxx:183
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:3398
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:2674
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1735
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:1163
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:141
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:95
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:2966
sal_Int64 toInt64(sal_Int16 radix=10) const
Returns the int64 value from this string.
Definition: ustring.hxx:3088
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:142
sal_Int32 compareTo(const OUString &str) const
Compares two strings.
Definition: ustring.hxx:694
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:968
bool equalsIgnoreAsciiCase(const OUString &str) const
Perform a ASCII lowercase comparison of two strings.
Definition: ustring.hxx:809
bool match(const OUString &str, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition: ustring.hxx:899
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:2369
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:39
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:2137
__sal_NoAcquire
Definition: types.h:366
sal_Int32 compareToIgnoreAsciiCase(const OUString &str) const
Perform a ASCII lowercase comparison of two strings.
Definition: ustring.hxx:834
static OUString number(int i, sal_Int16 radix=10)
Returns the string representation of the integer argument.
Definition: ustring.hxx:3345
bool startsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string starts with a given substring.
Definition: ustring.hxx:1307
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1751
OUString getToken(sal_Int32 token, sal_Unicode cTok, sal_Int32 &index) const
Returns a token in the string.
Definition: ustring.hxx:2997
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:473
#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:1573
bool equalsIgnoreAsciiCaseAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:1211
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:2931
sal_Int32 compareToAscii(const sal_Char *asciiStr) const
Compares two strings.
Definition: ustring.hxx:1038
static OUString boolean(bool b)
Returns the string representation of the boolean argument.
Definition: ustring.hxx:3450
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:3360
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:2699
OUString(sal_uInt32 const *codePoints, sal_Int32 codePointCount)
Create a new string from an array of Unicode code points.
Definition: ustring.hxx:378
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:2262
OUString(const sal_Unicode *value, sal_Int32 length)
New string from a Unicode character buffer array.
Definition: ustring.hxx:227
sal_Int32 reverseCompareTo(const OUString &str) const
Compares two strings in reverse order.
Definition: ustring.hxx:733
bool operator==(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:116
OUString & operator=(const OUString &str)
Assign a new string.
Definition: ustring.hxx:435
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:3666
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:249
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:1979
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:1694
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:2125
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:2403
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:370
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:3619
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:2725
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:1602
bool endsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string ends with a given substring.
Definition: ustring.hxx:1484
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:1500
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:3105
float toFloat() const
Returns the float value from this string.
Definition: ustring.hxx:3118
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:120
SAL_WARN_UNUSED_RESULT OUString copy(sal_Int32 beginIndex) const
Returns a new string that is a substring of this string.
Definition: ustring.hxx:2201
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:351
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:2282
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:3187
sal_Int32 reverseCompareToAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Compares two strings in reverse order.
Definition: ustring.hxx:1092
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:1899
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:307
char sal_Char
A legacy synonym for char.
Definition: types.h:121
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:523
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:3642
#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:2012
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:2336
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:2307
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:2948
OUString getToken(sal_Int32 count, sal_Unicode separator) const
Returns a token from the string.
Definition: ustring.hxx:3017
OUString(sal_Unicode value)
New string from a single Unicode character.
Definition: ustring.hxx:191
#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:3041
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:213
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:665
bool equalsAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Perform a comparison of two strings.
Definition: ustring.hxx:1136
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:1947
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:1962
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:409
static OUString const & unacquired(rtl_uString *const *ppHandle)
Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
Definition: ustring.hxx:427
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:2235
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:1397
friend OUString operator+(const OUString &rStr1, const OUString &rStr2)
Definition: ustring.hxx:2243
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:130
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:3283
sal_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:643
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:3354
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:3073
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:3372
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:3608
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:1619
~OUString()
Release the string data.
Definition: ustring.hxx:411
OString toUtf8() const
Convert this string to an OString, assuming that the string can be UTF-8-encoded successfully.
Definition: ustring.hxx:3322
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.