LibreOffice
LibreOffice 7.0 SDK C/C++ API Reference
|
Go to the documentation of this file.
20 #ifndef INCLUDED_RTL_USTRING_HXX
21 #define INCLUDED_RTL_USTRING_HXX
32 #if defined LIBO_INTERNAL_ONLY
33 #include <string_view>
41 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
42 #include "rtl/stringconcat.hxx"
45 #ifdef RTL_STRING_UNITTEST
46 extern bool rtl_string_unittest_invalid_conversion;
54 #ifdef RTL_STRING_UNITTEST
55 #define rtl rtlunittest
63 #ifdef RTL_STRING_UNITTEST
67 #if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
78 template<
typename T> constexpr OUStringLiteral(
80 typename libreoffice_internal::ConstCharArrayDetector<
81 T, libreoffice_internal::Dummy>::Type
82 = libreoffice_internal::Dummy()):
83 size(libreoffice_internal::ConstCharArrayDetector<T>::length),
85 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal))
88 libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal));
95 constexpr sal_Int32 getLength()
const {
return size; }
153 #if defined LIBO_INTERNAL_ONLY
201 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST_CONCAT
252 template<
typename T >
267 #ifdef RTL_STRING_UNITTEST
268 rtl_string_unittest_const_literal =
true;
272 #if defined LIBO_INTERNAL_ONLY
286 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
288 libreoffice_internal::ConstCharArrayDetector<T>::length);
293 #ifdef RTL_STRING_UNITTEST
298 template<
typename T >
303 rtl_string_unittest_invalid_conversion =
true;
309 template<
typename T >
314 rtl_string_unittest_invalid_conversion =
true;
318 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
335 OUString(OUStringLiteral literal): pData(NULL) {
362 throw std::bad_alloc();
383 sal_uInt32
const * codePoints, sal_Int32 codePointCount):
388 throw std::bad_alloc();
392 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
397 template<
typename T1,
typename T2 >
398 OUString( OUStringConcat< T1, T2 >&& c )
400 const sal_Int32 l = c.length();
415 template<
typename T >
416 OUString( OUStringNumber< T >&& n )
417 : OUString( n.buf, n.length )
421 #if defined LIBO_INTERNAL_ONLY
422 OUString(std::u16string_view sv) {
423 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
424 throw std::bad_alloc();
451 {
return *
reinterpret_cast< OUString const *
>( ppHandle ); }
464 #if defined LIBO_INTERNAL_ONLY
493 template<
typename T >
510 #if defined LIBO_INTERNAL_ONLY
515 operator =(T & literal) {
521 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
523 libreoffice_internal::ConstCharArrayDetector<T>::length);
529 OUString & operator =(OUStringLiteral
const & literal) {
530 if (literal.size == 0) {
539 #if defined LIBO_INTERNAL_ONLY
548 inline OUString & operator+=(
const OUStringBuffer & str ) &;
559 #if defined LIBO_INTERNAL_ONLY
563 return internalAppend(str.pData);
565 #if defined LIBO_INTERNAL_ONLY
566 void operator+=(
OUString const &) && =
delete;
577 operator +=(T & literal)
578 #if defined LIBO_INTERNAL_ONLY
590 #if defined LIBO_INTERNAL_ONLY
593 operator +=(T &) && =
delete;
596 #if defined LIBO_INTERNAL_ONLY
601 operator +=(T & literal) & {
610 libreoffice_internal::ConstCharArrayDetector<T, OUString &>::TypeUtf16
611 operator +=(T &) && =
delete;
614 OUString & operator +=(OUStringLiteral
const & literal) & {
618 void operator +=(OUStringLiteral
const &) && =
delete;
621 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
626 template<
typename T1,
typename T2 >
627 OUString& operator+=( OUStringConcat< T1, T2 >&& c ) & {
628 sal_Int32 l = c.length();
633 sal_Unicode* end = c.addData( pData->buffer + pData->length );
638 template<
typename T1,
typename T2>
void operator +=(
639 OUStringConcat<T1, T2> &&) && =
delete;
645 template<
typename T >
646 OUString& operator+=( OUStringNumber< T >&& n ) & {
647 sal_Int32 l = n.length;
652 sal_Unicode* end = addDataHelper( pData->buffer + pData->length, n.buf, n.length );
657 template<
typename T>
void operator +=(
658 OUStringNumber<T> &&) && =
delete;
690 return pData->length == 0;
713 assert(index >= 0 &&
static_cast<sal_uInt32
>(index) <
static_cast<sal_uInt32
>(getLength()));
714 return getStr()[index];
732 str.pData->buffer, str.pData->length );
753 str.pData->buffer, str.pData->length, maxLength );
771 str.pData->buffer, str.pData->length );
779 template<
typename T >
785 pData->buffer, pData->length,
790 #if defined LIBO_INTERNAL_ONLY
795 reverseCompareTo(T & literal)
const {
797 pData->buffer, pData->length,
803 sal_Int32 reverseCompareTo(OUStringLiteral
const & literal)
const {
805 pData->buffer, pData->length, literal.data, literal.size);
822 if ( pData->length != str.pData->length )
824 if ( pData == str.pData )
827 str.pData->buffer, str.pData->length ) == 0;
846 if ( pData->length != str.pData->length )
848 if ( pData == str.pData )
851 str.pData->buffer, str.pData->length ) == 0;
872 str.pData->buffer, str.pData->length );
881 template<
typename T >
890 pData->buffer, pData->length,
896 #if defined LIBO_INTERNAL_ONLY
900 equalsIgnoreAsciiCase(T & literal)
const {
903 pData->buffer, pData->length,
911 bool equalsIgnoreAsciiCase(OUStringLiteral
const & literal)
const {
912 return pData->length == literal.size
914 pData->buffer, pData->length, literal.data)
937 str.pData->buffer, str.pData->length, str.pData->length ) == 0;
945 template<
typename T >
952 pData->buffer+fromIndex, pData->length-fromIndex,
959 #if defined LIBO_INTERNAL_ONLY
963 match(T & literal, sal_Int32 fromIndex = 0)
const {
964 assert(fromIndex >= 0);
967 pData->buffer + fromIndex, pData->length - fromIndex,
976 bool match(OUStringLiteral
const & literal, sal_Int32 fromIndex = 0)
const {
979 pData->buffer + fromIndex, pData->length - fromIndex,
980 literal.data, literal.size)
1006 str.pData->buffer, str.pData->length,
1007 str.pData->length ) == 0;
1015 template<
typename T >
1022 pData->buffer+fromIndex, pData->length-fromIndex,
1029 #if defined LIBO_INTERNAL_ONLY
1031 template<
typename T>
1033 matchIgnoreAsciiCase(T & literal, sal_Int32 fromIndex = 0)
const {
1034 assert(fromIndex >= 0);
1037 pData->buffer + fromIndex, pData->length - fromIndex,
1046 bool matchIgnoreAsciiCase(
1047 OUStringLiteral
const & literal, sal_Int32 fromIndex = 0)
const
1051 pData->buffer+fromIndex, pData->length-fromIndex, literal.data,
1101 "replace s1.compareToAscii(s2, strlen(s2)) == 0 with s1.startsWith(s2)")
1102 sal_Int32 compareToAscii( const
sal_Char * asciiStr, sal_Int32 maxLength )
const
1105 asciiStr, maxLength );
1130 asciiStr, asciiStrLength );
1173 if ( pData->length != asciiStrLength )
1177 pData->buffer, asciiStr, asciiStrLength );
1248 if ( pData->length != asciiStrLength )
1278 asciiStr, asciiStrLength ) == 0;
1285 #if SAL_TYPES_SIZEOFLONG == 8
1316 asciiStr, asciiStrLength ) == 0;
1323 #if SAL_TYPES_SIZEOFLONG == 8
1343 bool b = match(str);
1344 if (b && rest != NULL) {
1355 template<
typename T >
1357 T & literal,
OUString * rest = NULL)
const
1363 <= sal_uInt32(pData->length))
1369 if (b && rest != NULL) {
1376 #if defined LIBO_INTERNAL_ONLY
1378 template<
typename T>
1380 startsWith(T & literal,
OUString * rest =
nullptr)
const {
1383 <= sal_uInt32(pData->length))
1391 if (b && rest !=
nullptr) {
1399 bool startsWith(OUStringLiteral
const & literal, OUString * rest =
nullptr)
1402 bool b = literal.size <= pData->length
1404 pData->buffer, literal.data, literal.size);
1405 if (b && rest !=
nullptr) {
1406 *rest = copy(literal.size);
1435 bool b = matchIgnoreAsciiCase(str);
1436 if (b && rest != NULL) {
1447 template<
typename T >
1461 if (b && rest != NULL) {
1468 #if defined LIBO_INTERNAL_ONLY
1470 template<
typename T>
1472 startsWithIgnoreAsciiCase(T & literal,
OUString * rest =
nullptr)
const {
1475 <= sal_uInt32(pData->length))
1483 if (b && rest !=
nullptr) {
1491 bool startsWithIgnoreAsciiCase(
1492 OUStringLiteral
const & literal, OUString * rest =
nullptr)
const
1496 pData->buffer, literal.size, literal.data, literal.size)
1498 if (b && rest !=
nullptr) {
1499 *rest = copy(literal.size);
1521 && match(str, getLength() - str.
getLength());
1522 if (b && rest != NULL) {
1523 *rest = copy(0, getLength() - str.
getLength());
1533 template<
typename T >
1541 <= sal_uInt32(pData->length))
1543 (pData->buffer + pData->length
1548 if (b && rest != NULL) {
1557 #if defined LIBO_INTERNAL_ONLY
1559 template<
typename T>
1561 endsWith(T & literal,
OUString * rest =
nullptr)
const {
1564 <= sal_uInt32(pData->length))
1566 (pData->buffer + pData->length
1573 if (b && rest !=
nullptr) {
1583 bool endsWith(OUStringLiteral
const & literal, OUString * rest =
nullptr)
1586 bool b = literal.size <= pData->length
1588 pData->buffer + pData->length - literal.size,
1589 literal.data, literal.size);
1590 if (b && rest !=
nullptr) {
1591 *rest = copy(0, (getLength() - literal.size));
1611 return asciiStrLength <= pData->length
1613 pData->buffer + pData->length - asciiStrLength, asciiStr,
1640 && matchIgnoreAsciiCase(str, getLength() - str.
getLength());
1641 if (b && rest != NULL) {
1642 *rest = copy(0, getLength() - str.
getLength());
1652 template<
typename T >
1660 <= sal_uInt32(pData->length))
1662 (pData->buffer + pData->length
1669 if (b && rest != NULL) {
1678 #if defined LIBO_INTERNAL_ONLY
1680 template<
typename T>
1682 endsWithIgnoreAsciiCase(T & literal,
OUString * rest =
nullptr)
const {
1685 <= sal_uInt32(pData->length))
1687 (pData->buffer + pData->length
1694 if (b && rest !=
nullptr) {
1704 bool endsWithIgnoreAsciiCase(
1705 OUStringLiteral
const & literal, OUString * rest =
nullptr)
const
1707 bool b = literal.size <= pData->length
1709 pData->buffer + pData->length - literal.size,
1710 literal.size, literal.data, literal.size)
1712 if (b && rest !=
nullptr) {
1713 *rest = copy(0, getLength() - literal.size);
1730 char const * asciiStr, sal_Int32 asciiStrLength)
const
1732 return asciiStrLength <= pData->length
1734 pData->buffer + pData->length - asciiStrLength,
1735 asciiStrLength, asciiStr, asciiStrLength)
1740 {
return rStr1.
equals(rStr2); }
1742 {
return rStr1.
compareTo( pStr2 ) == 0; }
1754 {
return rStr1.
compareTo( rStr2 ) < 0; }
1756 {
return rStr1.
compareTo( rStr2 ) > 0; }
1758 {
return rStr1.
compareTo( rStr2 ) <= 0; }
1760 {
return rStr1.
compareTo( rStr2 ) >= 0; }
1769 template<
typename T >
1785 template<
typename T >
1801 template<
typename T >
1817 template<
typename T >
1827 #if defined LIBO_INTERNAL_ONLY
1833 string.pData->buffer,
string.pData->length,
1840 template<
typename T>
friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
1844 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
1846 libreoffice_internal::ConstCharArrayDetector<T>::length,
1847 string.pData->buffer,
string.pData->length)
1851 template<
typename T>
friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
1855 string.pData->buffer,
string.pData->length,
1856 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
1858 libreoffice_internal::ConstCharArrayDetector<T>::length)
1862 template<
typename T>
friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
1866 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
1868 libreoffice_internal::ConstCharArrayDetector<T>::length,
1869 string.pData->buffer,
string.pData->length)
1874 #if defined LIBO_INTERNAL_ONLY
1882 friend bool operator ==(OUString
const & lhs, OUStringLiteral
const & rhs) {
1883 return lhs.equalsAsciiL(rhs.data, rhs.size);
1886 friend bool operator !=(OUString
const & lhs, OUStringLiteral
const & rhs) {
1887 return !lhs.equalsAsciiL(rhs.data, rhs.size);
1890 friend bool operator <(OUString
const & lhs, OUStringLiteral
const & rhs) {
1893 lhs.pData->buffer, lhs.pData->length, rhs.data))
1897 friend bool operator <=(OUString
const & lhs, OUStringLiteral
const & rhs) {
1900 lhs.pData->buffer, lhs.pData->length, rhs.data))
1904 friend bool operator >(OUString
const & lhs, OUStringLiteral
const & rhs) {
1907 lhs.pData->buffer, lhs.pData->length, rhs.data))
1911 friend bool operator >=(OUString
const & lhs, OUStringLiteral
const & rhs) {
1914 lhs.pData->buffer, lhs.pData->length, rhs.data))
1918 friend bool operator ==(OUStringLiteral
const & lhs, OUString
const & rhs) {
1919 return rhs.equalsAsciiL(lhs.data, lhs.size);
1922 friend bool operator !=(OUStringLiteral
const & lhs, OUString
const & rhs) {
1923 return !rhs.equalsAsciiL(lhs.data, lhs.size);
1926 friend bool operator <(OUStringLiteral
const & lhs, OUString
const & rhs) {
1929 rhs.pData->buffer, rhs.pData->length, lhs.data))
1933 friend bool operator <=(OUStringLiteral
const & lhs, OUString
const & rhs) {
1936 rhs.pData->buffer, rhs.pData->length, lhs.data))
1940 friend bool operator >(OUStringLiteral
const & lhs, OUString
const & rhs) {
1943 rhs.pData->buffer, rhs.pData->length, lhs.data))
1947 friend bool operator >=(OUStringLiteral
const & lhs, OUString
const & rhs) {
1950 rhs.pData->buffer, rhs.pData->length, lhs.data))
1985 return (ret < 0 ? ret : ret+fromIndex);
2037 str.pData->buffer, str.pData->length );
2038 return (ret < 0 ? ret : ret+fromIndex);
2046 template<
typename T >
2052 pData->buffer + fromIndex, pData->length - fromIndex,
2055 return n < 0 ? n : n + fromIndex;
2058 #if defined LIBO_INTERNAL_ONLY
2060 template<
typename T>
2063 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
2064 assert(fromIndex >= 0);
2066 pData->buffer + fromIndex, pData->length - fromIndex,
2069 return n < 0 ? n : n + fromIndex;
2073 sal_Int32 indexOf(OUStringLiteral
const & literal, sal_Int32 fromIndex = 0)
2077 pData->buffer + fromIndex, pData->length - fromIndex, literal.data,
2079 return n < 0 ? n : n + fromIndex;
2107 char const * str, sal_Int32 len, sal_Int32 fromIndex = 0)
const
2110 pData->buffer + fromIndex, pData->length - fromIndex, str, len);
2111 return ret < 0 ? ret : ret + fromIndex;
2118 #if SAL_TYPES_SIZEOFLONG == 8
2140 str.pData->buffer, str.pData->length );
2163 str.pData->buffer, str.pData->length );
2171 template<
typename T >
2177 pData->buffer, pData->length,
2182 #if defined LIBO_INTERNAL_ONLY
2184 template<
typename T>
2187 lastIndexOf(T & literal)
const {
2189 pData->buffer, pData->length,
2195 sal_Int32 lastIndexOf(OUStringLiteral
const & literal)
const {
2197 pData->buffer, pData->length, literal.data, literal.size);
2223 pData->buffer, pData->length, str, len);
2238 return copy(beginIndex, getLength() - beginIndex);
2255 rtl_uString *pNew = NULL;
2270 rtl_uString* pNew = NULL;
2275 #ifndef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
2278 return rStr1.
concat( rStr2 );
2297 rtl_uString* pNew = NULL;
2317 rtl_uString* pNew = NULL;
2341 OUString const & from,
OUString const & to, sal_Int32 * index = NULL)
const
2343 rtl_uString * s = NULL;
2346 &s, pData, from.pData, to.pData, index == NULL ? &i : index);
2368 template<
typename T >
2370 sal_Int32 * index = NULL)
const
2373 rtl_uString * s = NULL;
2379 index == NULL ? &i : index);
2401 template<
typename T >
2403 sal_Int32 * index = NULL)
const
2406 rtl_uString * s = NULL;
2409 &s, pData, from.pData,
2412 index == NULL ? &i : index);
2434 template<
typename T1,
typename T2 >
2440 rtl_uString * s = NULL;
2448 index == NULL ? &i : index);
2452 #if defined LIBO_INTERNAL_ONLY
2454 template<
typename T> [[nodiscard]]
2457 replaceFirst(T & from,
OUString const & to, sal_Int32 * index =
nullptr)
2460 rtl_uString * s =
nullptr;
2466 to.pData->buffer, to.pData->length, index ==
nullptr ? &i : index);
2468 throw std::bad_alloc();
2474 template<
typename T> [[nodiscard]]
2476 libreoffice_internal::ConstCharArrayDetector<T, OUString>::TypeUtf16
2477 replaceFirst(OUString
const & from, T & to, sal_Int32 * index =
nullptr)
2480 rtl_uString * s =
nullptr;
2483 &s, pData, from.pData->buffer, from.pData->length,
2484 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2485 libreoffice_internal::ConstCharArrayDetector<T>::length,
2486 index ==
nullptr ? &i : index);
2488 throw std::bad_alloc();
2494 template<
typename T1,
typename T2> [[nodiscard]]
2496 libreoffice_internal::ConstCharArrayDetector<
2498 typename libreoffice_internal::ConstCharArrayDetector<
2499 T2, OUString>::TypeUtf16
2501 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2502 rtl_uString * s =
nullptr;
2506 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2507 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2508 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2509 libreoffice_internal::ConstCharArrayDetector<T2>::length,
2510 index ==
nullptr ? &i : index);
2512 throw std::bad_alloc();
2518 template<
typename T1,
typename T2> [[nodiscard]]
2520 libreoffice_internal::ConstCharArrayDetector<
2522 typename libreoffice_internal::ConstCharArrayDetector<
2525 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2526 rtl_uString * s =
nullptr;
2530 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2531 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2532 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2533 libreoffice_internal::ConstCharArrayDetector<T2>::length,
2534 index ==
nullptr ? &i : index);
2536 throw std::bad_alloc();
2542 template<
typename T1,
typename T2> [[nodiscard]]
2544 libreoffice_internal::ConstCharArrayDetector<
2546 typename libreoffice_internal::ConstCharArrayDetector<
2547 T2, OUString>::TypeUtf16
2549 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2550 rtl_uString * s =
nullptr;
2554 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2555 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2556 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2557 libreoffice_internal::ConstCharArrayDetector<T2>::length,
2558 index ==
nullptr ? &i : index);
2560 throw std::bad_alloc();
2567 [[nodiscard]] OUString replaceFirst(
2568 OUStringLiteral
const & from, OUString
const & to,
2569 sal_Int32 * index =
nullptr)
const
2571 rtl_uString * s =
nullptr;
2574 &s, pData, from.data, from.size, to.pData,
2575 index ==
nullptr ? &i : index);
2579 [[nodiscard]] OUString replaceFirst(
2580 OUString
const & from, OUStringLiteral
const & to,
2581 sal_Int32 * index =
nullptr)
const
2583 rtl_uString * s =
nullptr;
2586 &s, pData, from.pData, to.data, to.size,
2587 index ==
nullptr ? &i : index);
2591 [[nodiscard]] OUString replaceFirst(
2592 OUStringLiteral
const & from, OUStringLiteral
const & to,
2593 sal_Int32 * index =
nullptr)
const
2595 rtl_uString * s =
nullptr;
2598 &s, pData, from.data, from.size, to.data, to.size,
2599 index ==
nullptr ? &i : index);
2603 template<
typename T> [[nodiscard]]
2604 typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2606 OUStringLiteral
const & from, T & to, sal_Int32 * index =
nullptr)
const
2608 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2609 rtl_uString * s =
nullptr;
2612 &s, pData, from.data, from.size,
2613 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2614 libreoffice_internal::ConstCharArrayDetector<T>::length,
2615 index ==
nullptr ? &i : index);
2619 template<
typename T> [[nodiscard]]
2620 typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2622 T & from, OUStringLiteral
const & to, sal_Int32 * index =
nullptr)
const
2624 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2625 rtl_uString * s =
nullptr;
2629 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2630 libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2631 to.size, index ==
nullptr ? &i : index);
2635 template<
typename T> [[nodiscard]]
2637 libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2639 OUStringLiteral
const & from, T & to, sal_Int32 * index =
nullptr)
const
2641 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2642 rtl_uString * s =
nullptr;
2645 &s, pData, from.data, from.size,
2646 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2647 libreoffice_internal::ConstCharArrayDetector<T>::length,
2648 index ==
nullptr ? &i : index);
2652 template<
typename T> [[nodiscard]]
2654 libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2656 T & from, OUStringLiteral
const & to, sal_Int32 * index =
nullptr)
const
2658 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2659 rtl_uString * s =
nullptr;
2663 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2664 libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2665 to.size, index ==
nullptr ? &i : index);
2688 rtl_uString * s = NULL;
2706 template<
typename T >
2710 rtl_uString * s = NULL;
2731 template<
typename T >
2735 rtl_uString * s = NULL;
2737 &s, pData, from.pData,
2756 template<
typename T1,
typename T2 >
2762 rtl_uString * s = NULL;
2772 #if defined LIBO_INTERNAL_ONLY
2774 template<
typename T> [[nodiscard]]
2777 replaceAll(T & from,
OUString const & to)
const {
2778 rtl_uString * s =
nullptr;
2783 to.pData->buffer, to.pData->length);
2785 throw std::bad_alloc();
2791 template<
typename T> [[nodiscard]]
2793 libreoffice_internal::ConstCharArrayDetector<T, OUString>::TypeUtf16
2794 replaceAll(OUString
const & from, T & to)
const {
2795 rtl_uString * s =
nullptr;
2797 &s, pData, from.pData->buffer, from.pData->length,
2798 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2799 libreoffice_internal::ConstCharArrayDetector<T>::length);
2801 throw std::bad_alloc();
2807 template<
typename T1,
typename T2> [[nodiscard]]
2809 libreoffice_internal::ConstCharArrayDetector<
2811 typename libreoffice_internal::ConstCharArrayDetector<
2812 T2, OUString>::TypeUtf16
2814 replaceAll(T1 & from, T2 & to)
const {
2815 rtl_uString * s =
nullptr;
2818 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2819 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2820 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2821 libreoffice_internal::ConstCharArrayDetector<T2>::length);
2823 throw std::bad_alloc();
2829 template<
typename T1,
typename T2> [[nodiscard]]
2831 libreoffice_internal::ConstCharArrayDetector<
2833 typename libreoffice_internal::ConstCharArrayDetector<
2836 replaceAll(T1 & from, T2 & to)
const {
2837 rtl_uString * s =
nullptr;
2840 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2841 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2842 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2843 libreoffice_internal::ConstCharArrayDetector<T2>::length);
2845 throw std::bad_alloc();
2851 template<
typename T1,
typename T2> [[nodiscard]]
2853 libreoffice_internal::ConstCharArrayDetector<
2855 typename libreoffice_internal::ConstCharArrayDetector<
2856 T2, OUString>::TypeUtf16
2858 replaceAll(T1 & from, T2 & to)
const {
2859 rtl_uString * s =
nullptr;
2862 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2863 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2864 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2865 libreoffice_internal::ConstCharArrayDetector<T2>::length);
2867 throw std::bad_alloc();
2874 [[nodiscard]] OUString replaceAll(
2875 OUStringLiteral
const & from, OUString
const & to)
const
2877 rtl_uString * s =
nullptr;
2879 &s, pData, from.data, from.size, to.pData);
2883 [[nodiscard]] OUString replaceAll(
2884 OUString
const & from, OUStringLiteral
const & to)
const
2886 rtl_uString * s =
nullptr;
2888 &s, pData, from.pData, to.data, to.size);
2892 [[nodiscard]] OUString replaceAll(
2893 OUStringLiteral
const & from, OUStringLiteral
const & to)
const
2895 rtl_uString * s =
nullptr;
2897 &s, pData, from.data, from.size, to.data, to.size);
2901 template<
typename T> [[nodiscard]]
2902 typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2903 replaceAll(OUStringLiteral
const & from, T & to)
const {
2904 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2905 rtl_uString * s =
nullptr;
2907 &s, pData, from.data, from.size,
2908 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2909 libreoffice_internal::ConstCharArrayDetector<T>::length);
2913 template<
typename T> [[nodiscard]]
2914 typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2915 replaceAll(T & from, OUStringLiteral
const & to)
const {
2916 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2917 rtl_uString * s =
nullptr;
2920 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2921 libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2926 template<
typename T> [[nodiscard]]
2928 libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2929 replaceAll(OUStringLiteral
const & from, T & to)
const {
2930 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2931 rtl_uString * s =
nullptr;
2933 &s, pData, from.data, from.size,
2934 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2935 libreoffice_internal::ConstCharArrayDetector<T>::length);
2939 template<
typename T> [[nodiscard]]
2941 libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2942 replaceAll(T & from, OUStringLiteral
const & to)
const {
2943 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2944 rtl_uString * s =
nullptr;
2947 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2948 libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2966 rtl_uString* pNew = NULL;
2983 rtl_uString* pNew = NULL;
3003 rtl_uString* pNew = NULL;
3034 rtl_uString * pNew = NULL;
3054 return getToken(count, separator, n);
3078 return pData->buffer[0];
3189 rtl_uString * pNew = NULL;
3192 throw std::bad_alloc();
3225 sal_uInt32 *pInfo = NULL )
3227 rtl_uString * pNew = NULL;
3229 convertFlags, pInfo );
3231 throw std::bad_alloc();
3261 sal_uInt32 nFlags)
const
3264 pData->length, nEncoding, nFlags);
3319 sal_Int32 * indexUtf16, sal_Int32 incrementCodePoints = 1)
const
3322 pData, indexUtf16, incrementCodePoints);
3370 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
3372 static OUStringNumber< int > number(
int i, sal_Int16 radix = 10 )
3374 return OUStringNumber< int >( i, radix );
3376 static OUStringNumber< long long > number(
long long ll, sal_Int16 radix = 10 )
3378 return OUStringNumber< long long >( ll, radix );
3380 static OUStringNumber< unsigned long long > number(
unsigned long long ll, sal_Int16 radix = 10 )
3382 return OUStringNumber< unsigned long long >( ll, radix );
3384 static OUStringNumber< unsigned long long > number(
unsigned int i, sal_Int16 radix = 10 )
3386 return number(
static_cast< unsigned long long >( i ), radix );
3388 static OUStringNumber< long long > number(
long i, sal_Int16 radix = 10)
3390 return number(
static_cast< long long >( i ), radix );
3392 static OUStringNumber< unsigned long long > number(
unsigned long i, sal_Int16 radix = 10 )
3394 return number(
static_cast< unsigned long long >( i ), radix );
3396 static OUStringNumber< float > number(
float f )
3398 return OUStringNumber< float >( f );
3400 static OUStringNumber< double > number(
double d )
3402 return OUStringNumber< double >( d );
3424 return number(
static_cast< unsigned long long >( i ), radix );
3430 return number(
static_cast< long long >( i ), radix );
3436 return number(
static_cast< unsigned long long >( i ), radix );
3541 return number( i, radix );
3556 return number( ll, radix );
3604 rtl_uString* pNew = NULL;
3609 #if defined LIBO_INTERNAL_ONLY
3610 operator std::u16string_view()
const {
return {getStr(), sal_uInt32(getLength())}; }
3614 OUString & internalAppend( rtl_uString* pOtherData )
3616 rtl_uString* pNewData = NULL;
3618 if (pNewData == NULL) {
3619 throw std::bad_alloc();
3628 #if defined LIBO_INTERNAL_ONLY
3634 void operator ==(OUString
const &, std::nullptr_t) =
delete;
3635 void operator ==(std::nullptr_t, OUString
const &) =
delete;
3636 void operator !=(OUString
const &, std::nullptr_t) =
delete;
3637 void operator !=(std::nullptr_t, OUString
const &) =
delete;
3640 #if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
3647 struct ToStringHelper< OUString >
3649 static std::size_t length(
const OUString& s ) {
return s.getLength(); }
3650 static sal_Unicode* addData(
sal_Unicode* buffer,
const OUString& s ) {
return addDataHelper( buffer, s.getStr(), s.getLength()); }
3651 static const bool allowOStringConcat =
false;
3652 static const bool allowOUStringConcat =
true;
3659 struct ToStringHelper< OUStringLiteral >
3661 static std::size_t length(
const OUStringLiteral& str ) {
return str.size; }
3662 static sal_Unicode* addData(
sal_Unicode* buffer,
const OUStringLiteral& str ) {
return addDataLiteral( buffer, str.data, str.size ); }
3663 static const bool allowOStringConcat =
false;
3664 static const bool allowOUStringConcat =
true;
3670 template<
typename charT,
typename traits,
typename T1,
typename T2 >
3671 inline std::basic_ostream<charT, traits> &
operator <<(
3672 std::basic_ostream<charT, traits> & stream, OUStringConcat< T1, T2 >&& concat)
3674 return stream << OUString( std::move(concat) );
3697 {
return static_cast<size_t>(rString.
hashCode()); }
3760 template<
typename charT,
typename traits >
3761 inline std::basic_ostream<charT, traits> &
operator <<(
3762 std::basic_ostream<charT, traits> & stream, OUString
const & rString)
3772 #ifdef RTL_STRING_UNITTEST
3775 typedef rtlunittest::OUString OUString;
3782 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
3783 using ::rtl::OUString;
3784 using ::rtl::OUStringHash;
3787 using ::rtl::OUStringLiteral;
3788 using ::rtl::OUStringChar;
3797 #if defined LIBO_INTERNAL_ONLY
3804 {
return std::size_t(s.
hashCode()); }
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_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.
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_WARN_UNUSED_RESULT OUString copy(sal_Int32 beginIndex) const
Returns a new string that is a substring of this string.
Definition: ustring.hxx:2236
SAL_DLLPUBLIC sal_Int32 rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Unicode *second, sal_Int32 secondLen, sal_Int32 shortenedLen) SAL_THROW_EXTERN_C()
Compare two strings with a maximum count of characters, ignoring the case of ASCII characters.
sal_Int32 lastIndexOf(const OUString &str, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition: ustring.hxx:2160
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.
char sal_Char
A legacy synonym for char.
Definition: types.h:116
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:2707
SAL_DLLPUBLIC void rtl_uString_newReplaceAllUtf16LUtf16L(rtl_uString **newStr, rtl_uString *str, sal_Unicode const *from, sal_Int32 fromLength, sal_Unicode const *to, sal_Int32 toLength) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
SAL_DLLPUBLIC sal_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.
bool operator>(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:100
bool startsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string starts with a given substring.
Definition: ustring.hxx:1342
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:2685
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,...
Definition: ustring.hxx:1982
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.
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:2220
sal_uInt64 toUInt64(sal_Int16 radix=10) const
Returns the uint64 value from this string.
Definition: ustring.hxx:3140
This String class provides base functionality for C++ like Unicode character array handling.
Definition: ustring.hxx:127
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:1432
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:1313
bool equalsIgnoreAsciiCase(const OUString &str) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:844
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_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition: textenc.h:33
OUString getToken(sal_Int32 count, sal_Unicode separator) const
Returns a token from the string.
Definition: ustring.hxx:3052
#define RTL_USTR_MAX_VALUEOFUINT64
Definition: ustring.h:1003
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:2172
sal_Int64 toInt64(sal_Int16 radix=10) const
Returns the int64 value from this string.
Definition: ustring.hxx:3123
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.
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:3422
sal_Unicode toChar() const
Returns the first character from this string.
Definition: ustring.hxx:3076
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.
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition: ustring.h:1041
@ SAL_NO_ACQUIRE
definition of a no acquire enum for ctors
Definition: types.h:370
This String class provide base functionality for C++ like 8-Bit character array handling.
Definition: string.hxx:98
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_WARN_UNUSED_RESULT OUString concat(const OUString &str) const
Concatenates the specified string to the end of this string.
Definition: ustring.hxx:2268
bool operator<(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:90
~OUString()
Release the string data.
Definition: ustring.hxx:434
sal_Int32 compareTo(const OUString &str) const
Compares two strings.
Definition: ustring.hxx:729
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:3719
OUString(rtl_uString *str, __sal_NoAcquire)
New OUString from OUString data without acquiring it.
Definition: ustring.hxx:187
float toFloat() const
Returns the float value from this string.
Definition: ustring.hxx:3153
SAL_DLLPUBLIC sal_Int32 rtl_ustr_indexOfChar_WithLength(const sal_Unicode *str, sal_Int32 len, sal_Unicode ch) SAL_THROW_EXTERN_C()
Search for the first occurrence of a character within a string.
sal_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:3318
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_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:2369
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.
OUString(const sal_Unicode *value, sal_Int32 length)
New string from a Unicode character buffer array.
Definition: ustring.hxx:231
static OUString number(double d)
Returns the string representation of the double argument.
Definition: ustring.hxx:3477
sal_Int32 compareToIgnoreAsciiCaseAscii(const sal_Char *asciiStr) const
Compares two ASCII strings ignoring case.
Definition: ustring.hxx:1221
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_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:678
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:1275
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.
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1818
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:558
sal_Int32 reverseCompareTo(const OUString &str) const
Compares two strings in reverse order.
Definition: ustring.hxx:768
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:576
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:1003
bool isEmpty() const
Checks if a string is empty.
Definition: ustring.hxx:688
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 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition: ustring.hxx:1997
#define OUSTRING_TO_OSTRING_CVTFLAGS
Definition: string.h:1350
bool equals(const OUString &str) const
Perform a comparison of two strings.
Definition: ustring.hxx:820
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:2253
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:3743
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:1535
SAL_DLLPUBLIC void rtl_uString_newReplaceFirstAsciiLAsciiL(rtl_uString **newStr, rtl_uString *str, char const *from, sal_Int32 fromLength, char const *to, sal_Int32 toLength, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_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.
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:2315
bool operator!=(const Any &rAny, const C &value)
Template inequality operator: compares set value of left side any to right side value.
Definition: Any.hxx:664
double toDouble() const
Returns the double value from this string.
Definition: ustring.hxx:3166
void clear()
Clears the string, i.e, makes a zero-character string.
Definition: ustring.hxx:665
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:2106
SAL_DLLPUBLIC void rtl_uString_intern(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Return a canonical representation for a string.
unsigned char sal_Bool
Definition: types.h:34
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:1016
SAL_DLLPUBLIC sal_uInt32 rtl_ustr_toUInt32(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an unsigned integer.
SAL_DLLPUBLIC 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_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:2436
static OUString number(int i, sal_Int16 radix=10)
Returns the string representation of the integer argument.
Definition: ustring.hxx:3415
SAL_DLLPUBLIC sal_Int32 rtl_ustr_hashCode_WithLength(const sal_Unicode *str, sal_Int32 len) SAL_THROW_EXTERN_C()
Return a hash code for a string.
SAL_DLLPUBLIC void rtl_uString_newFromStr(rtl_uString **newStr, const sal_Unicode *value) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
SAL_DLLPUBLIC void rtl_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
SAL_DLLPUBLIC void rtl_uString_assign(rtl_uString **str, rtl_uString *rightValue) SAL_THROW_EXTERN_C()
Assign a new value to a string.
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:882
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_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
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:3001
bool equalsAscii(const sal_Char *asciiStr) const
Perform a comparison of two strings.
Definition: ustring.hxx:1148
bool equalsIgnoreAsciiCaseAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:1246
SAL_DLLPUBLIC sal_Int32 rtl_ustr_reverseCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Unicode *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings from back to front.
sal_Int32 compareTo(const OUString &str, sal_Int32 maxLength) const
Compares two strings with a maximum count of characters.
Definition: ustring.hxx:750
SAL_DLLPUBLIC void rtl_uString_newReplace(rtl_uString **newStr, rtl_uString *str, sal_Unicode oldChar, sal_Unicode newChar) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a single character within another string.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_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_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.
#define RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
Definition: textcvt.h:71
#define RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
Definition: textcvt.h:147
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:3428
#define RTL_USTR_MAX_VALUEOFBOOLEAN
Definition: ustring.h:915
sal_Int32 lastIndexOf(sal_Unicode ch, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified character,...
Definition: ustring.hxx:2014
static OUString number(float f)
Returns the string representation of the float argument.
Definition: ustring.hxx:3462
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.
OUString intern() const
Return a canonical representation for a string.
Definition: ustring.hxx:3187
sal_Int32 compareToAscii(const sal_Char *asciiStr) const
Compares two strings.
Definition: ustring.hxx:1073
OUString(const OUString &str)
New string from OUString.
Definition: ustring.hxx:147
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.
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1802
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.
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_Int32 compareToIgnoreAsciiCase(const OUString &str) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:869
SAL_DLLPUBLIC double rtl_ustr_toDouble(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a double.
Definition: bootstrap.hxx:30
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 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:3440
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:1449
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:2981
SAL_DLLPUBLIC sal_Int32 rtl_uString_getToken(rtl_uString **newStr, rtl_uString *str, sal_Int32 token, sal_Unicode cTok, sal_Int32 idx) SAL_THROW_EXTERN_C()
Create a new string by extracting a single token from another string.
SAL_DLLPUBLIC void rtl_uString_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 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_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.
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:700
bool convertToString(OString *pTarget, rtl_TextEncoding nEncoding, sal_uInt32 nFlags) const
Converts to an OString, signalling failure.
Definition: ustring.hxx:3260
__sal_NoAcquire
Definition: types.h:367
#define RTL_USTR_MAX_VALUEOFINT64
Definition: ustring.h:980
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
OUString(sal_uInt32 const *codePoints, sal_Int32 codePointCount)
Create a new string from an array of Unicode code points.
Definition: ustring.hxx:382
friend OUString operator+(const OUString &rStr1, const OUString &rStr2)
Definition: ustring.hxx:2276
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.
#define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
Definition: textcvt.h:141
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.
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:946
#define OSTRING_TO_OUSTRING_CVTFLAGS
Definition: ustring.h:2145
sal_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition: ustring.hxx:2137
OUString(rtl_uString *str)
New string from OUString data.
Definition: ustring.hxx:173
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:463
const sal_Char * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the characters of this string.
Definition: string.hxx:455
SAL_DLLPUBLIC sal_Int32 rtl_ustr_toInt32(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an integer.
#define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
Definition: textcvt.h:68
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:3447
Definition: stringutils.hxx:130
bool endsWithAsciiL(char const *asciiStr, sal_Int32 asciiStrLength) const
Check whether this string ends with a given ASCII string.
Definition: ustring.hxx:1608
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.
OUString(const sal_Unicode *value)
New string from a Unicode character buffer array.
Definition: ustring.hxx:217
Dummy Type
Definition: stringutils.hxx:301
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:1356
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:2964
Definition: stringutils.hxx:185
bool endsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string ends with a given substring.
Definition: ustring.hxx:1519
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfFloat(sal_Unicode *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_compare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Unicode *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings.
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:2402
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.
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:1729
bool equalsAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Perform a comparison of two strings.
Definition: ustring.hxx:1171
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:298
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const sal_Char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition: ustring.h:1022
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:780
SAL_DLLPUBLIC void rtl_uString_newFromCodePoints(rtl_uString **newString, sal_uInt32 const *codePoints, sal_Int32 codePointCount) SAL_THROW_EXTERN_C()
Allocate a new string from an array of Unicode code points.
sal_Int32 getLength() const
Returns the length of this string.
Definition: string.hxx:429
SAL_DLLPUBLIC void rtl_uString_newReplaceAllToAsciiL(rtl_uString **newStr, rtl_uString *str, rtl_uString const *from, char const *to, sal_Int32 toLength) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
sal_Int32 indexOf(const OUString &str, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified substring,...
Definition: ustring.hxx:2034
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:494
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:2758
SAL_DLLPUBLIC void rtl_uString_newReplaceFirstUtf16LUtf16L(rtl_uString **newStr, rtl_uString *str, sal_Unicode const *from, sal_Int32 fromLength, sal_Unicode const *to, sal_Int32 toLength, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring.
SAL_DLLPUBLIC void rtl_uString_acquire(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Increment the reference count of a string.
bool toBoolean() const
Returns the Boolean value from this string.
Definition: ustring.hxx:3065
SAL_DLLPUBLIC void rtl_uString_newFromAscii(rtl_uString **newStr, const sal_Char *value) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
sal_uInt16 sal_Unicode
Definition: types.h:137
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.
static OUString boolean(bool b)
Returns the string representation of the boolean argument.
Definition: ustring.hxx:3511
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:3222
sal_Int32 reverseCompareToAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Compares two strings in reverse order.
Definition: ustring.hxx:1127
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.
#define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
Definition: textcvt.h:64
SAL_DLLPUBLIC void rtl_uString_newReplaceAllFromIndex(rtl_uString **newStr, rtl_uString *str, rtl_uString const *from, rtl_uString const *to, sal_Int32 fromIndex) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
SAL_DLLPUBLIC void rtl_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_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.
#define RTL_USTR_MAX_VALUEOFINT32
Definition: ustring.h:957
sal_Int32 hashCode() const
Returns a hashcode for this string.
Definition: ustring.hxx:1964
bool equalsIgnoreAsciiCaseAscii(const sal_Char *asciiStr) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:1198
static OUString createFromAscii(const sal_Char *value)
Returns an OUString copied without conversion from an ASCII character string.
Definition: ustring.hxx:3602
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.
static OUString const & unacquired(rtl_uString *const *ppHandle)
Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
Definition: ustring.hxx:450
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:2295
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:2732
SAL_DLLPUBLIC sal_Bool rtl_ustr_toBoolean(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a boolean.
bool operator==(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:110
Dummy Type
Definition: stringutils.hxx:279
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.
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:355
static OUString fromUtf8(const OString &rSource)
Convert an OString to an OUString, assuming that the OString is UTF-8-encoded.
Definition: ustring.hxx:3334
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1770
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1786
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:253
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 sal_Int32 rtl_ustr_valueOfDouble(sal_Unicode *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
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.
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,...
Definition: string.hxx:1951
SAL_DLLPUBLIC float rtl_ustr_toFloat(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a float.
OString toUtf8() const
Convert this string to an OString, assuming that the string can be UTF-8-encoded successfully.
Definition: ustring.hxx:3357
OUString()
New string containing no characters.
Definition: ustring.hxx:136
OUString(sal_Unicode value)
New string from a single Unicode character.
Definition: ustring.hxx:195
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:2340
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.
A helper to use OUStrings with hash maps.
Definition: ustring.hxx:3686
OUString & operator=(const OUString &str)
Assign a new string.
Definition: ustring.hxx:458
bool match(const OUString &str, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition: ustring.hxx:934
size_t operator()(const OUString &rString) const
Compute a hash code for a string.
Definition: ustring.hxx:3696
#define RTL_TEXTENCODING_UTF8
Definition: textenc.h:113
sal_Int32 toInt32(sal_Int16 radix=10) const
Returns the int32 value from this string.
Definition: ustring.hxx:3091
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:1637
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:1654
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_uInt32 toUInt32(sal_Int16 radix=10) const
Returns the uint32 value from this string.
Definition: ustring.hxx:3108
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.
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:2047
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.
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:3434
OUString getToken(sal_Int32 token, sal_Unicode cTok, sal_Int32 &index) const
Returns a token in the string.
Definition: ustring.hxx:3032