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 #ifndef _MSC_VER // TODO? 154 #if defined LIBO_INTERNAL_ONLY 203 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST_CONCAT 254 template<
typename T >
269 #ifdef RTL_STRING_UNITTEST 270 rtl_string_unittest_const_literal =
true;
274 #if defined LIBO_INTERNAL_ONLY 288 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
290 libreoffice_internal::ConstCharArrayDetector<T>::length);
295 #ifdef RTL_STRING_UNITTEST 300 template<
typename T >
305 rtl_string_unittest_invalid_conversion =
true;
311 template<
typename T >
316 rtl_string_unittest_invalid_conversion =
true;
320 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 337 OUString(OUStringLiteral literal): pData(NULL) {
364 throw std::bad_alloc();
385 sal_uInt32
const * codePoints, sal_Int32 codePointCount):
390 throw std::bad_alloc();
394 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 399 template<
typename T1,
typename T2 >
400 OUString( OUStringConcat< T1, T2 >&& c )
402 const sal_Int32 l = c.length();
417 template<
typename T >
418 OUString( OUStringNumber< T >&& n )
419 : OUString( n.buf, n.length )
423 #if defined LIBO_INTERNAL_ONLY 424 OUString(std::u16string_view sv) {
425 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
426 throw std::bad_alloc();
453 {
return *
reinterpret_cast< OUString const *
>( ppHandle ); }
466 #ifndef _MSC_VER // TODO? 467 #if defined LIBO_INTERNAL_ONLY 497 template<
typename T >
514 #if defined LIBO_INTERNAL_ONLY 519 operator =(T & literal) {
525 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
527 libreoffice_internal::ConstCharArrayDetector<T>::length);
533 OUString & operator =(OUStringLiteral
const & literal) {
534 if (literal.size == 0) {
543 #if defined LIBO_INTERNAL_ONLY 552 inline OUString & operator+=(
const OUStringBuffer & str ) &;
563 #if defined LIBO_INTERNAL_ONLY 567 return internalAppend(str.pData);
569 #if defined LIBO_INTERNAL_ONLY 570 void operator+=(
OUString const &) && =
delete;
581 operator +=(T & literal)
582 #if defined LIBO_INTERNAL_ONLY 594 #if defined LIBO_INTERNAL_ONLY 597 operator +=(T &) && =
delete;
600 #if defined LIBO_INTERNAL_ONLY 605 operator +=(T & literal) & {
614 libreoffice_internal::ConstCharArrayDetector<T, OUString &>::TypeUtf16
615 operator +=(T &) && =
delete;
618 OUString & operator +=(OUStringLiteral
const & literal) & {
622 void operator +=(OUStringLiteral
const &) && =
delete;
625 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 630 template<
typename T1,
typename T2 >
631 OUString& operator+=( OUStringConcat< T1, T2 >&& c ) & {
632 sal_Int32 l = c.length();
637 sal_Unicode* end = c.addData( pData->buffer + pData->length );
642 template<
typename T1,
typename T2>
void operator +=(
643 OUStringConcat<T1, T2> &&) && =
delete;
649 template<
typename T >
650 OUString& operator+=( OUStringNumber< T >&& n ) & {
651 sal_Int32 l = n.length;
656 sal_Unicode* end = addDataHelper( pData->buffer + pData->length, n.buf, n.length );
661 template<
typename T>
void operator +=(
662 OUStringNumber<T> &&) && =
delete;
694 return pData->length == 0;
717 assert(index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength()));
718 return getStr()[index];
736 str.pData->buffer, str.pData->length );
757 str.pData->buffer, str.pData->length, maxLength );
775 str.pData->buffer, str.pData->length );
783 template<
typename T >
789 pData->buffer, pData->length,
794 #if defined LIBO_INTERNAL_ONLY 799 reverseCompareTo(T & literal)
const {
801 pData->buffer, pData->length,
807 sal_Int32 reverseCompareTo(OUStringLiteral
const & literal)
const {
809 pData->buffer, pData->length, literal.data, literal.size);
826 if ( pData->length != str.pData->length )
828 if ( pData == str.pData )
831 str.pData->buffer, str.pData->length ) == 0;
850 if ( pData->length != str.pData->length )
852 if ( pData == str.pData )
855 str.pData->buffer, str.pData->length ) == 0;
876 str.pData->buffer, str.pData->length );
885 template<
typename T >
894 pData->buffer, pData->length,
900 #if defined LIBO_INTERNAL_ONLY 904 equalsIgnoreAsciiCase(T & literal)
const {
907 pData->buffer, pData->length,
915 bool equalsIgnoreAsciiCase(OUStringLiteral
const & literal)
const {
916 return pData->length == literal.size
918 pData->buffer, pData->length, literal.data)
941 str.pData->buffer, str.pData->length, str.pData->length ) == 0;
949 template<
typename T >
956 pData->buffer+fromIndex, pData->length-fromIndex,
963 #if defined LIBO_INTERNAL_ONLY 967 match(T & literal, sal_Int32 fromIndex = 0)
const {
968 assert(fromIndex >= 0);
971 pData->buffer + fromIndex, pData->length - fromIndex,
980 bool match(OUStringLiteral
const & literal, sal_Int32 fromIndex = 0)
const {
983 pData->buffer + fromIndex, pData->length - fromIndex,
984 literal.data, literal.size)
1010 str.pData->buffer, str.pData->length,
1011 str.pData->length ) == 0;
1019 template<
typename T >
1026 pData->buffer+fromIndex, pData->length-fromIndex,
1033 #if defined LIBO_INTERNAL_ONLY 1035 template<
typename T>
1037 matchIgnoreAsciiCase(T & literal, sal_Int32 fromIndex = 0)
const {
1038 assert(fromIndex >= 0);
1041 pData->buffer + fromIndex, pData->length - fromIndex,
1050 bool matchIgnoreAsciiCase(
1051 OUStringLiteral
const & literal, sal_Int32 fromIndex = 0)
const 1055 pData->buffer+fromIndex, pData->length-fromIndex, literal.data,
1105 "replace s1.compareToAscii(s2, strlen(s2)) == 0 with s1.startsWith(s2)")
1106 sal_Int32 compareToAscii( const
sal_Char * asciiStr, sal_Int32 maxLength )
const 1109 asciiStr, maxLength );
1134 asciiStr, asciiStrLength );
1177 if ( pData->length != asciiStrLength )
1181 pData->buffer, asciiStr, asciiStrLength );
1252 if ( pData->length != asciiStrLength )
1282 asciiStr, asciiStrLength ) == 0;
1289 #if SAL_TYPES_SIZEOFLONG == 8 1320 asciiStr, asciiStrLength ) == 0;
1327 #if SAL_TYPES_SIZEOFLONG == 8 1347 bool b = match(str);
1348 if (b && rest != NULL) {
1359 template<
typename T >
1361 T & literal,
OUString * rest = NULL)
const 1367 <= sal_uInt32(pData->length))
1373 if (b && rest != NULL) {
1380 #if defined LIBO_INTERNAL_ONLY 1382 template<
typename T>
1384 startsWith(T & literal,
OUString * rest =
nullptr)
const {
1387 <= sal_uInt32(pData->length))
1395 if (b && rest !=
nullptr) {
1403 bool startsWith(OUStringLiteral
const & literal, OUString * rest =
nullptr)
1406 bool b = literal.size <= pData->length
1408 pData->buffer, literal.data, literal.size);
1409 if (b && rest !=
nullptr) {
1410 *rest = copy(literal.size);
1439 bool b = matchIgnoreAsciiCase(str);
1440 if (b && rest != NULL) {
1451 template<
typename T >
1465 if (b && rest != NULL) {
1472 #if defined LIBO_INTERNAL_ONLY 1474 template<
typename T>
1476 startsWithIgnoreAsciiCase(T & literal,
OUString * rest =
nullptr)
const {
1479 <= sal_uInt32(pData->length))
1487 if (b && rest !=
nullptr) {
1495 bool startsWithIgnoreAsciiCase(
1496 OUStringLiteral
const & literal, OUString * rest =
nullptr)
const 1500 pData->buffer, literal.size, literal.data, literal.size)
1502 if (b && rest !=
nullptr) {
1503 *rest = copy(literal.size);
1525 && match(str, getLength() - str.
getLength());
1526 if (b && rest != NULL) {
1527 *rest = copy(0, getLength() - str.
getLength());
1537 template<
typename T >
1545 <= sal_uInt32(pData->length))
1547 (pData->buffer + pData->length
1552 if (b && rest != NULL) {
1561 #if defined LIBO_INTERNAL_ONLY 1563 template<
typename T>
1565 endsWith(T & literal,
OUString * rest =
nullptr)
const {
1568 <= sal_uInt32(pData->length))
1570 (pData->buffer + pData->length
1577 if (b && rest !=
nullptr) {
1587 bool endsWith(OUStringLiteral
const & literal, OUString * rest =
nullptr)
1590 bool b = literal.size <= pData->length
1592 pData->buffer + pData->length - literal.size,
1593 literal.data, literal.size);
1594 if (b && rest !=
nullptr) {
1595 *rest = copy(0, (getLength() - literal.size));
1615 return asciiStrLength <= pData->length
1617 pData->buffer + pData->length - asciiStrLength, asciiStr,
1644 && matchIgnoreAsciiCase(str, getLength() - str.
getLength());
1645 if (b && rest != NULL) {
1646 *rest = copy(0, getLength() - str.
getLength());
1656 template<
typename T >
1664 <= sal_uInt32(pData->length))
1666 (pData->buffer + pData->length
1673 if (b && rest != NULL) {
1682 #if defined LIBO_INTERNAL_ONLY 1684 template<
typename T>
1686 endsWithIgnoreAsciiCase(T & literal,
OUString * rest =
nullptr)
const {
1689 <= sal_uInt32(pData->length))
1691 (pData->buffer + pData->length
1698 if (b && rest !=
nullptr) {
1708 bool endsWithIgnoreAsciiCase(
1709 OUStringLiteral
const & literal, OUString * rest =
nullptr)
const 1711 bool b = literal.size <= pData->length
1713 pData->buffer + pData->length - literal.size,
1714 literal.size, literal.data, literal.size)
1716 if (b && rest !=
nullptr) {
1717 *rest = copy(0, getLength() - literal.size);
1734 char const * asciiStr, sal_Int32 asciiStrLength)
const 1736 return asciiStrLength <= pData->length
1738 pData->buffer + pData->length - asciiStrLength,
1739 asciiStrLength, asciiStr, asciiStrLength)
1744 {
return rStr1.
equals(rStr2); }
1746 {
return rStr1.
compareTo( pStr2 ) == 0; }
1758 {
return rStr1.
compareTo( rStr2 ) < 0; }
1760 {
return rStr1.
compareTo( rStr2 ) > 0; }
1762 {
return rStr1.
compareTo( rStr2 ) <= 0; }
1764 {
return rStr1.
compareTo( rStr2 ) >= 0; }
1773 template<
typename T >
1789 template<
typename T >
1805 template<
typename T >
1821 template<
typename T >
1831 #if defined LIBO_INTERNAL_ONLY 1837 string.pData->buffer,
string.pData->length,
1844 template<
typename T>
friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
1848 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
1850 libreoffice_internal::ConstCharArrayDetector<T>::length,
1851 string.pData->buffer,
string.pData->length)
1855 template<
typename T>
friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
1859 string.pData->buffer,
string.pData->length,
1860 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
1862 libreoffice_internal::ConstCharArrayDetector<T>::length)
1866 template<
typename T>
friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
1870 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
1872 libreoffice_internal::ConstCharArrayDetector<T>::length,
1873 string.pData->buffer,
string.pData->length)
1878 #if defined LIBO_INTERNAL_ONLY 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) {
1891 return !lhs.equalsAsciiL(rhs.data, rhs.size);
1894 friend bool operator <(OUString
const & lhs, OUStringLiteral
const & rhs) {
1897 lhs.pData->buffer, lhs.pData->length, rhs.data))
1901 friend bool operator <=(OUString
const & lhs, OUStringLiteral
const & rhs) {
1904 lhs.pData->buffer, lhs.pData->length, rhs.data))
1908 friend bool operator >(OUString
const & lhs, OUStringLiteral
const & rhs) {
1911 lhs.pData->buffer, lhs.pData->length, rhs.data))
1915 friend bool operator >=(OUString
const & lhs, OUStringLiteral
const & rhs) {
1918 lhs.pData->buffer, lhs.pData->length, rhs.data))
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) {
1927 return !rhs.equalsAsciiL(lhs.data, lhs.size);
1930 friend bool operator <(OUStringLiteral
const & lhs, OUString
const & rhs) {
1933 rhs.pData->buffer, rhs.pData->length, lhs.data))
1937 friend bool operator <=(OUStringLiteral
const & lhs, OUString
const & rhs) {
1940 rhs.pData->buffer, rhs.pData->length, lhs.data))
1944 friend bool operator >(OUStringLiteral
const & lhs, OUString
const & rhs) {
1947 rhs.pData->buffer, rhs.pData->length, lhs.data))
1951 friend bool operator >=(OUStringLiteral
const & lhs, OUString
const & rhs) {
1954 rhs.pData->buffer, rhs.pData->length, lhs.data))
1989 return (ret < 0 ? ret : ret+fromIndex);
2041 str.pData->buffer, str.pData->length );
2042 return (ret < 0 ? ret : ret+fromIndex);
2050 template<
typename T >
2056 pData->buffer + fromIndex, pData->length - fromIndex,
2059 return n < 0 ? n : n + fromIndex;
2062 #if defined LIBO_INTERNAL_ONLY 2064 template<
typename T>
2067 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
2068 assert(fromIndex >= 0);
2070 pData->buffer + fromIndex, pData->length - fromIndex,
2073 return n < 0 ? n : n + fromIndex;
2077 sal_Int32 indexOf(OUStringLiteral
const & literal, sal_Int32 fromIndex = 0)
2081 pData->buffer + fromIndex, pData->length - fromIndex, literal.data,
2083 return n < 0 ? n : n + fromIndex;
2111 char const * str, sal_Int32 len, sal_Int32 fromIndex = 0)
const 2114 pData->buffer + fromIndex, pData->length - fromIndex, str, len);
2115 return ret < 0 ? ret : ret + fromIndex;
2122 #if SAL_TYPES_SIZEOFLONG == 8 2144 str.pData->buffer, str.pData->length );
2167 str.pData->buffer, str.pData->length );
2175 template<
typename T >
2181 pData->buffer, pData->length,
2186 #if defined LIBO_INTERNAL_ONLY 2188 template<
typename T>
2191 lastIndexOf(T & literal)
const {
2193 pData->buffer, pData->length,
2199 sal_Int32 lastIndexOf(OUStringLiteral
const & literal)
const {
2201 pData->buffer, pData->length, literal.data, literal.size);
2227 pData->buffer, pData->length, str, len);
2242 return copy(beginIndex, getLength() - beginIndex);
2259 rtl_uString *pNew = NULL;
2274 rtl_uString* pNew = NULL;
2279 #ifndef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 2282 return rStr1.
concat( rStr2 );
2301 rtl_uString* pNew = NULL;
2321 rtl_uString* pNew = NULL;
2345 OUString const & from,
OUString const & to, sal_Int32 * index = NULL)
const 2347 rtl_uString * s = NULL;
2350 &s, pData, from.pData, to.pData, index == NULL ? &i : index);
2372 template<
typename T >
2374 sal_Int32 * index = NULL)
const 2377 rtl_uString * s = NULL;
2383 index == NULL ? &i : index);
2405 template<
typename T >
2407 sal_Int32 * index = NULL)
const 2410 rtl_uString * s = NULL;
2413 &s, pData, from.pData,
2416 index == NULL ? &i : index);
2438 template<
typename T1,
typename T2 >
2444 rtl_uString * s = NULL;
2452 index == NULL ? &i : index);
2456 #if defined LIBO_INTERNAL_ONLY 2458 template<
typename T> [[nodiscard]]
2461 replaceFirst(T & from,
OUString const & to, sal_Int32 * index =
nullptr)
2464 rtl_uString * s =
nullptr;
2470 to.pData->buffer, to.pData->length, index ==
nullptr ? &i : index);
2472 throw std::bad_alloc();
2478 template<
typename T> [[nodiscard]]
2480 libreoffice_internal::ConstCharArrayDetector<T, OUString>::TypeUtf16
2481 replaceFirst(OUString
const & from, T & to, sal_Int32 * index =
nullptr)
2484 rtl_uString * s =
nullptr;
2487 &s, pData, from.pData->buffer, from.pData->length,
2488 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2489 libreoffice_internal::ConstCharArrayDetector<T>::length,
2490 index ==
nullptr ? &i : index);
2492 throw std::bad_alloc();
2498 template<
typename T1,
typename T2> [[nodiscard]]
2500 libreoffice_internal::ConstCharArrayDetector<
2502 typename libreoffice_internal::ConstCharArrayDetector<
2503 T2, OUString>::TypeUtf16
2505 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2506 rtl_uString * s =
nullptr;
2510 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2511 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2512 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2513 libreoffice_internal::ConstCharArrayDetector<T2>::length,
2514 index ==
nullptr ? &i : index);
2516 throw std::bad_alloc();
2522 template<
typename T1,
typename T2> [[nodiscard]]
2524 libreoffice_internal::ConstCharArrayDetector<
2526 typename libreoffice_internal::ConstCharArrayDetector<
2529 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2530 rtl_uString * s =
nullptr;
2534 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2535 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2536 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2537 libreoffice_internal::ConstCharArrayDetector<T2>::length,
2538 index ==
nullptr ? &i : index);
2540 throw std::bad_alloc();
2546 template<
typename T1,
typename T2> [[nodiscard]]
2548 libreoffice_internal::ConstCharArrayDetector<
2550 typename libreoffice_internal::ConstCharArrayDetector<
2551 T2, OUString>::TypeUtf16
2553 replaceFirst(T1 & from, T2 & to, sal_Int32 * index =
nullptr)
const {
2554 rtl_uString * s =
nullptr;
2558 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2559 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2560 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2561 libreoffice_internal::ConstCharArrayDetector<T2>::length,
2562 index ==
nullptr ? &i : index);
2564 throw std::bad_alloc();
2571 [[nodiscard]] OUString replaceFirst(
2572 OUStringLiteral
const & from, OUString
const & to,
2573 sal_Int32 * index =
nullptr)
const 2575 rtl_uString * s =
nullptr;
2578 &s, pData, from.data, from.size, to.pData,
2579 index ==
nullptr ? &i : index);
2583 [[nodiscard]] OUString replaceFirst(
2584 OUString
const & from, OUStringLiteral
const & to,
2585 sal_Int32 * index =
nullptr)
const 2587 rtl_uString * s =
nullptr;
2590 &s, pData, from.pData, to.data, to.size,
2591 index ==
nullptr ? &i : index);
2595 [[nodiscard]] OUString replaceFirst(
2596 OUStringLiteral
const & from, OUStringLiteral
const & to,
2597 sal_Int32 * index =
nullptr)
const 2599 rtl_uString * s =
nullptr;
2602 &s, pData, from.data, from.size, to.data, to.size,
2603 index ==
nullptr ? &i : index);
2607 template<
typename T> [[nodiscard]]
2608 typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2610 OUStringLiteral
const & from, T & to, sal_Int32 * index =
nullptr)
const 2612 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2613 rtl_uString * s =
nullptr;
2616 &s, pData, from.data, from.size,
2617 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2618 libreoffice_internal::ConstCharArrayDetector<T>::length,
2619 index ==
nullptr ? &i : index);
2623 template<
typename T> [[nodiscard]]
2624 typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2626 T & from, OUStringLiteral
const & to, sal_Int32 * index =
nullptr)
const 2628 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2629 rtl_uString * s =
nullptr;
2633 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2634 libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2635 to.size, index ==
nullptr ? &i : index);
2639 template<
typename T> [[nodiscard]]
2641 libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2643 OUStringLiteral
const & from, T & to, sal_Int32 * index =
nullptr)
const 2645 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2646 rtl_uString * s =
nullptr;
2649 &s, pData, from.data, from.size,
2650 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2651 libreoffice_internal::ConstCharArrayDetector<T>::length,
2652 index ==
nullptr ? &i : index);
2656 template<
typename T> [[nodiscard]]
2658 libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2660 T & from, OUStringLiteral
const & to, sal_Int32 * index =
nullptr)
const 2662 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2663 rtl_uString * s =
nullptr;
2667 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2668 libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2669 to.size, index ==
nullptr ? &i : index);
2692 rtl_uString * s = NULL;
2710 template<
typename T >
2714 rtl_uString * s = NULL;
2735 template<
typename T >
2739 rtl_uString * s = NULL;
2741 &s, pData, from.pData,
2760 template<
typename T1,
typename T2 >
2766 rtl_uString * s = NULL;
2776 #if defined LIBO_INTERNAL_ONLY 2778 template<
typename T> [[nodiscard]]
2781 replaceAll(T & from,
OUString const & to)
const {
2782 rtl_uString * s =
nullptr;
2787 to.pData->buffer, to.pData->length);
2789 throw std::bad_alloc();
2795 template<
typename T> [[nodiscard]]
2797 libreoffice_internal::ConstCharArrayDetector<T, OUString>::TypeUtf16
2798 replaceAll(OUString
const & from, T & to)
const {
2799 rtl_uString * s =
nullptr;
2801 &s, pData, from.pData->buffer, from.pData->length,
2802 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2803 libreoffice_internal::ConstCharArrayDetector<T>::length);
2805 throw std::bad_alloc();
2811 template<
typename T1,
typename T2> [[nodiscard]]
2813 libreoffice_internal::ConstCharArrayDetector<
2815 typename libreoffice_internal::ConstCharArrayDetector<
2816 T2, OUString>::TypeUtf16
2818 replaceAll(T1 & from, T2 & to)
const {
2819 rtl_uString * s =
nullptr;
2822 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2823 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2824 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2825 libreoffice_internal::ConstCharArrayDetector<T2>::length);
2827 throw std::bad_alloc();
2833 template<
typename T1,
typename T2> [[nodiscard]]
2835 libreoffice_internal::ConstCharArrayDetector<
2837 typename libreoffice_internal::ConstCharArrayDetector<
2840 replaceAll(T1 & from, T2 & to)
const {
2841 rtl_uString * s =
nullptr;
2844 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2845 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2846 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2847 libreoffice_internal::ConstCharArrayDetector<T2>::length);
2849 throw std::bad_alloc();
2855 template<
typename T1,
typename T2> [[nodiscard]]
2857 libreoffice_internal::ConstCharArrayDetector<
2859 typename libreoffice_internal::ConstCharArrayDetector<
2860 T2, OUString>::TypeUtf16
2862 replaceAll(T1 & from, T2 & to)
const {
2863 rtl_uString * s =
nullptr;
2866 libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2867 libreoffice_internal::ConstCharArrayDetector<T1>::length,
2868 libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2869 libreoffice_internal::ConstCharArrayDetector<T2>::length);
2871 throw std::bad_alloc();
2878 [[nodiscard]] OUString replaceAll(
2879 OUStringLiteral
const & from, OUString
const & to)
const 2881 rtl_uString * s =
nullptr;
2883 &s, pData, from.data, from.size, to.pData);
2887 [[nodiscard]] OUString replaceAll(
2888 OUString
const & from, OUStringLiteral
const & to)
const 2890 rtl_uString * s =
nullptr;
2892 &s, pData, from.pData, to.data, to.size);
2896 [[nodiscard]] OUString replaceAll(
2897 OUStringLiteral
const & from, OUStringLiteral
const & to)
const 2899 rtl_uString * s =
nullptr;
2901 &s, pData, from.data, from.size, to.data, to.size);
2905 template<
typename T> [[nodiscard]]
2906 typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2907 replaceAll(OUStringLiteral
const & from, T & to)
const {
2908 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2909 rtl_uString * s =
nullptr;
2911 &s, pData, from.data, from.size,
2912 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2913 libreoffice_internal::ConstCharArrayDetector<T>::length);
2917 template<
typename T> [[nodiscard]]
2918 typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2919 replaceAll(T & from, OUStringLiteral
const & to)
const {
2920 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2921 rtl_uString * s =
nullptr;
2924 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2925 libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2930 template<
typename T> [[nodiscard]]
2932 libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2933 replaceAll(OUStringLiteral
const & from, T & to)
const {
2934 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2935 rtl_uString * s =
nullptr;
2937 &s, pData, from.data, from.size,
2938 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2939 libreoffice_internal::ConstCharArrayDetector<T>::length);
2943 template<
typename T> [[nodiscard]]
2945 libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2946 replaceAll(T & from, OUStringLiteral
const & to)
const {
2947 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2948 rtl_uString * s =
nullptr;
2951 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2952 libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2970 rtl_uString* pNew = NULL;
2987 rtl_uString* pNew = NULL;
3007 rtl_uString* pNew = NULL;
3038 rtl_uString * pNew = NULL;
3058 return getToken(count, separator, n);
3082 return pData->buffer[0];
3193 rtl_uString * pNew = NULL;
3196 throw std::bad_alloc();
3229 sal_uInt32 *pInfo = NULL )
3231 rtl_uString * pNew = NULL;
3233 convertFlags, pInfo );
3235 throw std::bad_alloc();
3265 sal_uInt32 nFlags)
const 3268 pData->length, nEncoding, nFlags);
3323 sal_Int32 * indexUtf16, sal_Int32 incrementCodePoints = 1)
const 3326 pData, indexUtf16, incrementCodePoints);
3374 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 3376 static OUStringNumber< int > number(
int i, sal_Int16 radix = 10 )
3378 return OUStringNumber< int >( i, radix );
3380 static OUStringNumber< long long > number(
long long ll, sal_Int16 radix = 10 )
3382 return OUStringNumber< long long >( ll, radix );
3384 static OUStringNumber< unsigned long long > number(
unsigned long long ll, sal_Int16 radix = 10 )
3386 return OUStringNumber< unsigned long long >( ll, radix );
3388 static OUStringNumber< unsigned long long > number(
unsigned int i, sal_Int16 radix = 10 )
3390 return number( static_cast< unsigned long long >( i ), radix );
3392 static OUStringNumber< long long > number(
long i, sal_Int16 radix = 10)
3394 return number( static_cast< long long >( i ), radix );
3396 static OUStringNumber< unsigned long long > number(
unsigned long i, sal_Int16 radix = 10 )
3398 return number( static_cast< unsigned long long >( i ), radix );
3400 static OUStringNumber< float > number(
float f )
3402 return OUStringNumber< float >( f );
3404 static OUStringNumber< double > number(
double d )
3406 return OUStringNumber< double >( d );
3428 return number( static_cast< unsigned long long >( i ), radix );
3434 return number( static_cast< long long >( i ), radix );
3440 return number( static_cast< unsigned long long >( i ), radix );
3545 return number( i, radix );
3560 return number( ll, radix );
3608 rtl_uString* pNew = NULL;
3613 #if defined LIBO_INTERNAL_ONLY 3614 operator std::u16string_view()
const {
return {getStr(), sal_uInt32(getLength())}; }
3618 OUString & internalAppend( rtl_uString* pOtherData )
3620 rtl_uString* pNewData = NULL;
3622 if (pNewData == NULL) {
3623 throw std::bad_alloc();
3632 #if defined LIBO_INTERNAL_ONLY 3638 void operator ==(OUString
const &, std::nullptr_t) =
delete;
3639 void operator ==(std::nullptr_t, OUString
const &) =
delete;
3640 void operator !=(OUString
const &, std::nullptr_t) =
delete;
3641 void operator !=(std::nullptr_t, OUString
const &) =
delete;
3644 #if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 3651 struct ToStringHelper< OUString >
3653 static std::size_t length(
const OUString& s ) {
return s.getLength(); }
3654 static sal_Unicode* addData(
sal_Unicode* buffer,
const OUString& s ) {
return addDataHelper( buffer, s.getStr(), s.getLength()); }
3655 static const bool allowOStringConcat =
false;
3656 static const bool allowOUStringConcat =
true;
3663 struct ToStringHelper< OUStringLiteral >
3665 static std::size_t length(
const OUStringLiteral& str ) {
return str.size; }
3666 static sal_Unicode* addData(
sal_Unicode* buffer,
const OUStringLiteral& str ) {
return addDataLiteral( buffer, str.data, str.size ); }
3667 static const bool allowOStringConcat =
false;
3668 static const bool allowOUStringConcat =
true;
3674 template<
typename charT,
typename traits,
typename T1,
typename T2 >
3675 inline std::basic_ostream<charT, traits> &
operator <<(
3676 std::basic_ostream<charT, traits> & stream, OUStringConcat< T1, T2 >&& concat)
3678 return stream << OUString( std::move(concat) );
3701 {
return static_cast<size_t>(rString.
hashCode()); }
3764 template<
typename charT,
typename traits >
3766 std::basic_ostream<charT, traits> & stream,
OUString const & rString)
3776 #ifdef RTL_STRING_UNITTEST 3779 typedef rtlunittest::OUString OUString;
3786 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST 3787 using ::rtl::OUString;
3788 using ::rtl::OUStringHash;
3791 using ::rtl::OUStringLiteral;
3792 using ::rtl::OUStringChar;
3801 #if defined LIBO_INTERNAL_ONLY 3808 {
return std::size_t(s.
hashCode()); }
#define OUSTRING_TO_OSTRING_CVTFLAGS
Definition: string.h:1350
sal_Int32 getLength() const
Returns the length of this string.
Definition: string.hxx:433
OUString(sal_uInt32 const *codePoints, sal_Int32 codePointCount)
Create a new string from an array of Unicode code points.
Definition: ustring.hxx:384
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:3747
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:2038
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:3438
double toDouble() const
Returns the double value from this string.
Definition: ustring.hxx:3170
OUString getToken(sal_Int32 count, sal_Unicode separator) const
Returns a token from the string.
Definition: ustring.hxx:3056
#define RTL_TEXTENCODING_UTF8
Definition: textenc.h:113
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_intern(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Return a canonical representation for 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:1733
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 ...
Definition: ustring.hxx:1020
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 ...
Definition: ustring.hxx:1360
#define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
Definition: textcvt.h:64
size_t operator()(const OUString &rString) const
Compute a hash code for a string.
Definition: ustring.hxx:3700
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 createFromAscii(const sal_Char *value)
Returns an OUString copied without conversion from an ASCII character string.
Definition: ustring.hxx:3606
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:3723
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 ...
Definition: ustring.hxx:886
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...
friend OUString operator+(const OUString &rStr1, const OUString &rStr2)
Definition: ustring.hxx:2280
SAL_WARN_UNUSED_RESULT OUString concat(const OUString &str) const
Concatenates the specified string to the end of this string.
Definition: ustring.hxx:2272
static OUString fromUtf8(const OString &rSource)
Convert an OString to an OUString, assuming that the OString is UTF-8-encoded.
Definition: ustring.hxx:3338
SAL_WARN_UNUSED_RESULT OUString copy(sal_Int32 beginIndex) const
Returns a new string that is a substring of this string.
Definition: ustring.hxx:2240
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_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:682
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.
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:1955
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1774
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.
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition: ustring.h:1022
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 ...
Definition: ustring.hxx:1453
#define RTL_USTR_MAX_VALUEOFUINT64
Definition: ustring.h:1003
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const sal_Char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
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:3451
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 ...
Definition: ustring.hxx:1658
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...
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 ...
Definition: ustring.hxx:2051
sal_Int32 compareTo(const OUString &str) const
Compares two strings.
Definition: ustring.hxx:733
SAL_DLLPUBLIC void rtl_uString_newReplaceStrAt(rtl_uString **newStr, rtl_uString *str, sal_Int32 idx, sal_Int32 count, rtl_uString *subStr) SAL_THROW_EXTERN_C()
Create a new string by replacing a substring of another string.
SAL_DLLPUBLIC sal_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_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:2164
sal_Unicode toChar() const
Returns the first character from this string.
Definition: ustring.hxx:3080
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:1007
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
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_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_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.
bool operator<(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:90
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_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_Int32 compareToIgnoreAsciiCase(const OUString &str) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:873
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 ...
Definition: ustring.hxx:950
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
bool startsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string starts with a given substring.
Definition: ustring.hxx:1346
static OUString const & unacquired(rtl_uString *const *ppHandle)
Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
Definition: ustring.hxx:452
OUString getToken(sal_Int32 token, sal_Unicode cTok, sal_Int32 &index) const
Returns a token in the string.
Definition: ustring.hxx:3036
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:1279
bool operator>(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:100
SAL_DLLPUBLIC sal_Int32 rtl_ustr_shortenedCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Unicode *second, sal_Int32 secondLen, sal_Int32 shortenedLen) SAL_THROW_EXTERN_C()
Compare two strings with a maximum count of characters.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_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.
bool operator==(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:110
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.
Definition: stringutils.hxx:130
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:2968
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:465
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:3322
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:578
SAL_DLLPUBLIC sal_Int32 rtl_ustr_toInt32(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an integer.
sal_Int32 toInt32(sal_Int16 radix=10) const
Returns the int32 value from this string.
Definition: ustring.hxx:3095
bool equalsIgnoreAsciiCaseAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:1250
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:3426
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.
Definition: stringutils.hxx:184
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:704
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.
SAL_DLLPUBLIC void rtl_uString_acquire(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Increment the reference count of a string.
sal_Int32 compareTo(const OUString &str, sal_Int32 maxLength) const
Compares two strings with a maximum count of characters.
Definition: ustring.hxx:754
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:2985
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.
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition: ustring.h:1041
static OUString number(float f)
Returns the string representation of the float argument.
Definition: ustring.hxx:3466
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.
#define RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
Definition: textcvt.h:147
bool equalsAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Perform a comparison of two strings.
Definition: ustring.hxx:1175
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:1986
bool equalsIgnoreAsciiCaseAscii(const sal_Char *asciiStr) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:1202
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...
SAL_DLLPUBLIC void rtl_uString_newFromStr_WithLength(rtl_uString **newStr, const sal_Unicode *value, sal_Int32 len) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
SAL_DLLPUBLIC 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_uInt16 sal_Unicode
Definition: types.h:141
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_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:2762
OUString(rtl_uString *str)
New string from OUString data.
Definition: ustring.hxx:175
unsigned char sal_Bool
Definition: types.h:38
const sal_Char * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the characters of this string.
Definition: string.hxx:459
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:2319
__sal_NoAcquire
Definition: types.h:370
bool equalsIgnoreAsciiCase(const OUString &str) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:848
SAL_DLLPUBLIC void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
bool match(const OUString &str, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition: ustring.hxx:938
bool convertToString(OString *pTarget, rtl_TextEncoding nEncoding, sal_uInt32 nFlags) const
Converts to an OString, signalling failure.
Definition: ustring.hxx:3264
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1806
SAL_DLLPUBLIC void rtl_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
#define OSTRING_TO_OUSTRING_CVTFLAGS
Definition: ustring.h:2145
SAL_DLLPUBLIC sal_Bool rtl_ustr_toBoolean(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a boolean.
#define RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
Definition: textcvt.h:71
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.
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:562
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:2257
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:2736
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 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_newReplaceFirstAsciiL(rtl_uString **newStr, rtl_uString *str, char const *from, sal_Int32 fromLength, rtl_uString const *to, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring...
sal_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition: textenc.h:33
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.
~OUString()
Release the string data.
Definition: ustring.hxx:436
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.
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:1317
#define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
Definition: textcvt.h:141
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:2141
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.
Definition: bootstrap.hxx:29
bool endsWithAsciiL(char const *asciiStr, sal_Int32 asciiStrLength) const
Check whether this string ends with a given ASCII string.
Definition: ustring.hxx:1612
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...
OUString(rtl_uString *str, __sal_NoAcquire)
New OUString from OUString data without acquiring it.
Definition: ustring.hxx:189
SAL_DLLPUBLIC sal_uInt32 rtl_uString_iterateCodePoints(rtl_uString const *string, sal_Int32 *indexUtf16, sal_Int32 incrementCodePoints)
Iterate through a string based on code points instead of UTF-16 code units.
sal_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:2110
OUString(const sal_Unicode *value)
New string from a Unicode character buffer array.
Definition: ustring.hxx:219
sal_Int32 compareToIgnoreAsciiCaseAscii(const sal_Char *asciiStr) const
Compares two ASCII strings ignoring case.
Definition: ustring.hxx:1225
A helper to use OUStrings with hash maps.
Definition: ustring.hxx:3689
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.
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:2001
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.
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:2711
OUString(const OUString &str)
New string from OUString.
Definition: ustring.hxx:147
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.
This String class provide base functionality for C++ like 8-Bit character array handling.
Definition: string.hxx:97
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 ...
Definition: ustring.hxx:1539
definition of a no acquire enum for ctors
Definition: types.h:374
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfAscii_WithLength(sal_Unicode const *str, sal_Int32 len, char const *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the last occurrence of an ASCII substring within a string.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_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...
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:2440
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_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:2406
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...
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:3226
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.
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 ...
Definition: ustring.hxx:2176
sal_Int32 reverseCompareToAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Compares two strings in reverse order.
Definition: ustring.hxx:1131
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...
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_uInt32 toUInt32(sal_Int16 radix=10) const
Returns the uint32 value from this string.
Definition: ustring.hxx:3112
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1790
bool endsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string ends with a given substring.
Definition: ustring.hxx:1523
bool equals(const OUString &str) const
Perform a comparison of two strings.
Definition: ustring.hxx:824
static OUString number(int i, sal_Int16 radix=10)
Returns the string representation of the integer argument.
Definition: ustring.hxx:3419
SAL_DLLPUBLIC void rtl_uString_newFromStr(rtl_uString **newStr, const sal_Unicode *value) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfInt64(sal_Unicode *str, sal_Int64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of a long integer.
float toFloat() const
Returns the float value from this string.
Definition: ustring.hxx:3157
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.
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:126
void clear()
Clears the string, i.e, makes a zero-character string.
Definition: ustring.hxx:669
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...
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:498
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:302
OString toUtf8() const
Convert this string to an OString, assuming that the string can be UTF-8-encoded successfully.
Definition: ustring.hxx:3361
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:2373
char sal_Char
A legacy synonym for char.
Definition: types.h:120
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_DLLPUBLIC sal_Int32 rtl_ustr_valueOfFloat(sal_Unicode *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
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.
static OUString boolean(bool b)
Returns the string representation of the boolean argument.
Definition: ustring.hxx:3515
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...
static OUString number(double d)
Returns the string representation of the double argument.
Definition: ustring.hxx:3481
SAL_DLLPUBLIC void rtl_uString_newReplaceFirstUtf16LUtf16L(rtl_uString **newStr, rtl_uString *str, sal_Unicode const *from, sal_Int32 fromLength, sal_Unicode const *to, sal_Int32 toLength, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring...
SAL_DLLPUBLIC sal_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_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.
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1822
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:2224
#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_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:2344
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...
bool equalsAscii(const sal_Char *asciiStr) const
Perform a comparison of two strings.
Definition: ustring.hxx:1152
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:2299
#define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
Definition: textcvt.h:68
sal_Int32 reverseCompareTo(const OUString &str) const
Compares two strings in reverse order.
Definition: ustring.hxx:772
bool isEmpty() const
Checks if a string is empty.
Definition: ustring.hxx:692
OUString(sal_Unicode value)
New string from a single Unicode character.
Definition: ustring.hxx:197
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:3005
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:1436
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfUInt64(sal_Unicode *str, sal_uInt64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an unsigned long integer.
sal_Int64 toInt64(sal_Int16 radix=10) const
Returns the int64 value from this string.
Definition: ustring.hxx:3127
Dummy Type
Definition: stringutils.hxx:279
OUString(const sal_Unicode *value, sal_Int32 length)
New string from a Unicode character buffer array.
Definition: ustring.hxx:233
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:2018
OUString & operator=(const OUString &str)
Assign a new string.
Definition: ustring.hxx:460
bool toBoolean() const
Returns the Boolean value from this string.
Definition: ustring.hxx:3069
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:255
sal_Int32 hashCode() const
Returns a hashcode for this string.
Definition: ustring.hxx:1968
#define RTL_USTR_MAX_VALUEOFINT64
Definition: ustring.h:980
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:2689
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:1641
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:3444
sal_uInt64 toUInt64(sal_Int16 radix=10) const
Returns the uint64 value from this string.
Definition: ustring.hxx:3144
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 ...
Definition: ustring.hxx:784
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:357
OUString()
New string containing no characters.
Definition: ustring.hxx:136
Dummy Type
Definition: stringutils.hxx:301
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfDouble(sal_Unicode *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
OUString intern() const
Return a canonical representation for a string.
Definition: ustring.hxx:3191
sal_Int32 compareToAscii(const sal_Char *asciiStr) const
Compares two strings.
Definition: ustring.hxx:1077
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.
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:3432