24#ifndef INCLUDED_RTL_USTRING_HXX
25#define INCLUDED_RTL_USTRING_HXX
35#if defined LIBO_INTERNAL_ONLY
45#ifdef LIBO_INTERNAL_ONLY
46#include "config_global.h"
47#include "o3tl/safeint.hxx"
48#include "rtl/stringconcat.hxx"
51#ifdef RTL_STRING_UNITTEST
52extern bool rtl_string_unittest_invalid_conversion;
60#ifdef RTL_STRING_UNITTEST
61#define rtl rtlunittest
69#ifdef RTL_STRING_UNITTEST
73#if defined LIBO_INTERNAL_ONLY
83 static_assert(N != 0);
84 static_assert(N - 1 <= std::numeric_limits<sal_Int32>::max(),
"literal too long");
92 OUStringLiteral(
char16_t const (&literal)[N]) {
94 assert(literal[N - 1] ==
'\0');
95 std::copy_n(literal, N, more.buffer);
98 constexpr sal_Int32 getLength()
const {
return more.length; }
100 constexpr sal_Unicode const * getStr() const SAL_RETURNS_NONNULL {
return more.buffer; }
102 constexpr operator std::u16string_view()
const {
return {more.buffer, sal_uInt32(more.length)}; }
105 static constexpr void assertLayout() {
108 static_assert(std::is_standard_layout_v<OUStringLiteral>);
109 static_assert(offsetof(OUStringLiteral, str.refCount) == offsetof(OUStringLiteral, more.refCount));
110 static_assert(offsetof(OUStringLiteral, str.length) == offsetof(OUStringLiteral, more.length));
111 static_assert(offsetof(OUStringLiteral, str.buffer) == offsetof(OUStringLiteral, more.buffer));
118 sal_Int32 length = N - 1;
131#if defined RTL_STRING_UNITTEST
133template<std::
size_t N>
struct ExceptConstCharArrayDetector<OUStringLiteral<N>> {};
134template<std::
size_t N>
struct ExceptCharArrayDetector<OUStringLiteral<N>> {};
177#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
182#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
183 pData =
const_cast<rtl_uString *
>(&empty.str);
194#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
200#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
201 if (std::is_constant_evaluated()) {
213#if defined LIBO_INTERNAL_ONLY
214#if !defined(__COVERITY__)
221#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
227#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
228 if (std::is_constant_evaluated()) {
255#if defined LIBO_INTERNAL_ONLY
284#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST_CONCAT
295#if defined LIBO_INTERNAL_ONLY
297 template<
typename T>
explicit OUString(
299 typename libreoffice_internal::CharPtrDetector<T, libreoffice_internal::Dummy>::TypeUtf16
300 = libreoffice_internal::Dummy()):
304 template<
typename T>
explicit OUString(
307 libreoffice_internal::NonConstCharArrayDetector<T, libreoffice_internal::Dummy>::TypeUtf16
308 = libreoffice_internal::Dummy()):
356 template<
typename T >
371#ifdef RTL_STRING_UNITTEST
372 rtl_string_unittest_const_literal =
true;
376#if defined LIBO_INTERNAL_ONLY
388#if defined LIBO_INTERNAL_ONLY && defined RTL_STRING_UNITTEST
394 template<
typename T >
395 OUString( T&,
typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
399 rtl_string_unittest_invalid_conversion =
true;
405 template<
typename T >
406 OUString(
const T&,
typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
410 rtl_string_unittest_invalid_conversion =
true;
415#ifdef LIBO_INTERNAL_ONLY
422 template<std::
size_t N>
constexpr OUString(OUStringLiteral<N>
const & literal):
423 pData(const_cast<rtl_uString *>(&literal.str)) {}
424 template<std::
size_t N> OUString(OUStringLiteral<N> &&) =
delete;
428#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
430 template<OStringLiteral L> OUString(detail::OStringHolder<L>
const & holder) {
432 if (holder.literal.getLength() == 0) {
436 &pData, holder.literal.getStr(), holder.literal.getLength(), 0);
462 throw std::bad_alloc();
483 sal_uInt32
const * codePoints, sal_Int32 codePointCount):
488 throw std::bad_alloc();
492#ifdef LIBO_INTERNAL_ONLY
497 template<
typename T1,
typename T2 >
498 OUString( OUStringConcat< T1, T2 >&& c )
500 const sal_Int32 l = c.length();
514 template< std::
size_t N >
515 OUString( OUStringNumber< N >&& n )
516 : OUString( n.buf, n.length )
520#if defined LIBO_INTERNAL_ONLY
521 explicit OUString(std::u16string_view sv) {
522 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
523 throw std::bad_alloc();
533#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
538#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
539 if (std::is_constant_evaluated()) {
563 {
return *
reinterpret_cast< OUString const *
>( ppHandle ); }
565#if defined LIBO_INTERNAL_ONLY
592#if defined LIBO_INTERNAL_ONLY
593#if !defined(__COVERITY__)
602 std::swap(pData, str.pData);
620 template<
typename T >
637#if defined LIBO_INTERNAL_ONLY
643 operator =(T &) =
delete;
645 OUString & operator =(OUStringChar c) {
651 template<std::
size_t N> OUString & operator =(OUStringLiteral<N>
const & literal) {
653 pData =
const_cast<rtl_uString *
>(&literal.str);
656 template<std::
size_t N> OUString & operator =(OUStringLiteral<N> &&) =
delete;
658 template <std::
size_t N>
659 OUString & operator =(OUStringNumber<N> && n) {
665 OUString & operator =(std::u16string_view sv) {
675#if defined LIBO_INTERNAL_ONLY
684 inline OUString & operator+=(
const OUStringBuffer & str ) &;
695#if defined LIBO_INTERNAL_ONLY
699 return internalAppend(str.pData);
701#if defined LIBO_INTERNAL_ONLY
702 void operator+=(
OUString const &) && =
delete;
713 operator +=(T & literal)
714#if defined LIBO_INTERNAL_ONLY
726#if defined LIBO_INTERNAL_ONLY
729 operator +=(T &) && =
delete;
732#if defined LIBO_INTERNAL_ONLY
737 operator +=(T & literal) & {
746 libreoffice_internal::ConstCharArrayDetector<T, OUString &>::TypeUtf16
747 operator +=(T &) && =
delete;
750 template<std::
size_t N> OUString & operator +=(OUStringLiteral<N>
const & literal) & {
754 template<std::
size_t N>
void operator +=(OUStringLiteral<N>
const &) && =
delete;
756 OUString & operator +=(std::u16string_view sv) & {
757 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
758 throw std::bad_alloc();
763 void operator +=(std::u16string_view) && =
delete;
766#ifdef LIBO_INTERNAL_ONLY
771 template<
typename T1,
typename T2 >
772 OUString& operator+=( OUStringConcat< T1, T2 >&& c ) & {
773 sal_Int32 l = c.length();
778 sal_Unicode* end = c.addData( pData->buffer + pData->length );
783 template<
typename T1,
typename T2>
void operator +=(
784 OUStringConcat<T1, T2> &&) && =
delete;
790 template< std::
size_t N >
791 OUString& operator+=( OUStringNumber< N >&& n ) & {
792 sal_Int32 l = n.length;
797 sal_Unicode* end = addDataHelper( pData->buffer + pData->length, n.buf, n.length );
802 template<std::
size_t N>
void operator +=(
803 OUStringNumber<N> &&) && =
delete;
835 return pData->length == 0;
858 assert(index >= 0 &&
static_cast<sal_uInt32
>(index) <
static_cast<sal_uInt32
>(
getLength()));
874#if defined LIBO_INTERNAL_ONLY
875 sal_Int32 compareTo( std::u16string_view str )
const
878 str.data(), str.length() );
884 str.pData->buffer, str.pData->length );
903#if defined LIBO_INTERNAL_ONLY
904 sal_Int32 compareTo( std::u16string_view str, sal_Int32 maxLength )
const
907 str.data(), str.length(), maxLength );
913 str.pData->buffer, str.pData->length, maxLength );
929#if defined LIBO_INTERNAL_ONLY
930 sal_Int32 reverseCompareTo(std::u16string_view sv)
const {
932 pData->buffer, pData->length, sv.data(), sv.size());
938 str.pData->buffer, str.pData->length );
947 template<
typename T >
953 pData->buffer, pData->length,
971 if ( pData->length != str.pData->length )
973 if ( pData == str.pData )
976 str.pData->buffer, str.pData->length ) == 0;
993#if defined LIBO_INTERNAL_ONLY
994 bool equalsIgnoreAsciiCase(std::u16string_view sv)
const {
995 if ( sal_uInt32(pData->length) != sv.size() )
997 if ( pData->buffer == sv.data() )
1001 pData->buffer, pData->length, sv.data(), sv.size())
1007 if ( pData->length != str.pData->length )
1009 if ( pData == str.pData )
1012 str.pData->buffer, str.pData->length ) == 0;
1031#if defined LIBO_INTERNAL_ONLY
1032 sal_Int32 compareToIgnoreAsciiCase(std::u16string_view sv)
const {
1034 pData->buffer, pData->length, sv.data(), sv.size());
1040 str.pData->buffer, str.pData->length );
1049 template<
typename T >
1058 pData->buffer, pData->length,
1079#if defined LIBO_INTERNAL_ONLY
1080 bool match(std::u16string_view sv, sal_Int32 fromIndex = 0)
const {
1081 assert(fromIndex >= 0);
1084 pData->buffer + fromIndex, pData->length - fromIndex, sv.data(), sv.size(),
1091 assert(fromIndex >= 0);
1093 str.pData->buffer, str.pData->length, str.pData->length ) == 0;
1102 template<
typename T >
1107 assert(fromIndex >= 0);
1110 pData->buffer+fromIndex, pData->length-fromIndex,
1135#if defined LIBO_INTERNAL_ONLY
1136 bool matchIgnoreAsciiCase(std::u16string_view sv, sal_Int32 fromIndex = 0)
const {
1137 assert(fromIndex >= 0);
1140 pData->buffer + fromIndex, pData->length - fromIndex, sv.data(), sv.size(),
1147 assert(fromIndex >= 0);
1149 str.pData->buffer, str.pData->length,
1150 str.pData->length ) == 0;
1159 template<
typename T >
1213 "replace s1.compareToAscii(s2, strlen(s2)) == 0 with s1.startsWith(s2)")
1217 asciiStr, maxLength );
1241 asciiStr, asciiStrLength );
1283 if ( pData->length != asciiStrLength )
1287 pData->buffer, asciiStr, asciiStrLength );
1313#if defined LIBO_INTERNAL_ONLY
1314 bool equalsIgnoreAsciiCaseAscii( std::string_view asciiStr )
const
1316 return o3tl::make_unsigned(pData->length) == asciiStr.length()
1318 pData->buffer, pData->length, asciiStr.data(), asciiStr.length()) == 0;
1345#if defined LIBO_INTERNAL_ONLY
1346 sal_Int32 compareToIgnoreAsciiCaseAscii( std::string_view asciiStr )
const
1348 sal_Int32 nMax = std::min<size_t>(asciiStr.length(), std::numeric_limits<sal_Int32>::max());
1350 pData->buffer, pData->length, asciiStr.data(), nMax);
1351 if (result == 0 && o3tl::make_unsigned(pData->length) < asciiStr.length())
1378 if ( pData->length != asciiStrLength )
1404 bool matchAsciiL(
const char* asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex = 0 )
const
1406 assert(fromIndex >= 0);
1408 asciiStr, asciiStrLength ) == 0;
1415#if SAL_TYPES_SIZEOFLONG == 8
1444 assert(fromIndex >= 0);
1446 asciiStr, asciiStrLength ) == 0;
1453#if SAL_TYPES_SIZEOFLONG == 8
1458#if defined LIBO_INTERNAL_ONLY
1469 bool startsWith(std::u16string_view sv)
const {
1486 bool startsWith(std::u16string_view sv, OUString * rest)
const {
1488 auto const b = startsWith(sv);
1490 *rest = copy(sv.size());
1507 bool startsWith(std::u16string_view sv, std::u16string_view * rest)
const {
1509 auto const b = startsWith(sv);
1511 *rest = subView(sv.size());
1531 bool b =
match(str);
1532 if (b && rest != NULL) {
1539#if defined LIBO_INTERNAL_ONLY
1544 template<
typename T >
1552 <= sal_uInt32(pData->length))
1565 template<
typename T >
1566 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWith(
1567 T & literal, OUString * rest)
const
1570 bool b = startsWith(literal);
1573 libreoffice_internal::ConstCharArrayDetector<T>::length);
1581 template<
typename T >
1582 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWith(
1583 T & literal, std::u16string_view * rest)
const
1586 bool b = startsWith(literal);
1589 libreoffice_internal::ConstCharArrayDetector<T>::length);
1599 template<
typename T >
1601 T & literal,
OUString * rest = NULL)
const
1607 <= sal_uInt32(pData->length))
1613 if (b && rest != NULL) {
1632 return !
isEmpty() && pData->buffer[0] == ch;
1657#if defined LIBO_INTERNAL_ONLY
1670 bool startsWith(
sal_Unicode ch, std::u16string_view* rest)
const {
1672 bool b = startsWith(ch);
1701#if defined LIBO_INTERNAL_ONLY
1702 bool startsWithIgnoreAsciiCase(std::u16string_view sv)
const {
1703 return matchIgnoreAsciiCase(sv);
1705 bool startsWithIgnoreAsciiCase(std::u16string_view sv, OUString * rest)
const {
1707 auto const b = startsWithIgnoreAsciiCase(sv);
1709 *rest = copy(sv.size());
1713 bool startsWithIgnoreAsciiCase(std::u16string_view sv, std::u16string_view * rest)
const {
1715 auto const b = startsWithIgnoreAsciiCase(sv);
1717 *rest = subView(sv.size());
1726 if (b && rest != NULL) {
1733#if defined LIBO_INTERNAL_ONLY
1739 template<
typename T >
1741 startsWithIgnoreAsciiCase(T & literal)
const
1747 <= sal_uInt32(pData->length))
1762 template<
typename T >
1763 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
1764 startsWithIgnoreAsciiCase(T & literal, OUString * rest)
const
1767 bool b = startsWithIgnoreAsciiCase(literal);
1770 libreoffice_internal::ConstCharArrayDetector<T>::length);
1778 template<
typename T >
1779 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
1780 startsWithIgnoreAsciiCase(T & literal, std::u16string_view * rest)
const
1783 bool b = startsWithIgnoreAsciiCase(literal);
1786 libreoffice_internal::ConstCharArrayDetector<T>::length);
1796 template<
typename T >
1797 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
1804 <= sal_uInt32(pData->length))
1812 if (b && rest != NULL) {
1820#if defined LIBO_INTERNAL_ONLY
1831 bool endsWith(std::u16string_view sv)
const {
1832 return sv.size() <= sal_uInt32(pData->length)
1833 && match(sv, pData->length - sv.size());
1835 bool endsWith(std::u16string_view sv, OUString * rest)
const {
1836 auto const b = endsWith(sv);
1837 if (b && rest !=
nullptr) {
1838 *rest = copy(0, (pData->length - sv.size()));
1855 bool endsWith(std::u16string_view sv, std::u16string_view * rest)
const {
1857 auto const b = endsWith(sv);
1859 *rest = subView(0, (pData->length - sv.size()));
1881 if (b && rest != NULL) {
1899 return !
isEmpty() && pData->buffer[pData->length - 1] == ch;
1919 *rest =
copy(0, pData->length - 1);
1924#if defined LIBO_INTERNAL_ONLY
1937 bool endsWith(
sal_Unicode ch, std::u16string_view* rest)
const {
1939 bool b = endsWith(ch);
1942 *rest = subView(0, pData->length - 1);
1948#if defined LIBO_INTERNAL_ONLY
1954 template<
typename T >
1955 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
1956 endsWith(T & literal)
const
1959 libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal));
1961 = (libreoffice_internal::ConstCharArrayDetector<T>::length
1962 <= sal_uInt32(pData->length))
1964 (pData->buffer + pData->length
1965 - libreoffice_internal::ConstCharArrayDetector<T>::length),
1966 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
1968 libreoffice_internal::ConstCharArrayDetector<T>::length);
1971 template<
typename T >
1972 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
1973 endsWith(T & literal, OUString * rest)
const
1976 bool b = endsWith(literal);
1981 - libreoffice_internal::ConstCharArrayDetector<T>::length));
1985 template<
typename T >
1986 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
1987 endsWith(T & literal, std::u16string_view * rest)
const
1990 bool b = endsWith(literal);
1995 - libreoffice_internal::ConstCharArrayDetector<T>::length));
2005 template<
typename T >
2006 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
2013 <= sal_uInt32(pData->length))
2015 (pData->buffer + pData->length
2020 if (b && rest != NULL) {
2044 return asciiStrLength <= pData->length
2046 pData->buffer + pData->length - asciiStrLength, asciiStr,
2050#if defined LIBO_INTERNAL_ONLY
2071 bool endsWithIgnoreAsciiCase(std::u16string_view sv)
const {
2072 return sv.size() <= sal_uInt32(pData->length)
2073 && matchIgnoreAsciiCase(sv, pData->length - sv.size());
2075 bool endsWithIgnoreAsciiCase(std::u16string_view sv, OUString * rest)
const {
2076 auto const b = endsWithIgnoreAsciiCase(sv);
2077 if (b && rest !=
nullptr) {
2078 *rest = copy(0, pData->length - sv.size());
2101 bool endsWithIgnoreAsciiCase(std::u16string_view sv, std::u16string_view * rest)
const {
2103 auto const b = endsWithIgnoreAsciiCase(sv);
2105 *rest = subView(0, pData->length - sv.size());
2134 if (b && rest != NULL) {
2141#if defined LIBO_INTERNAL_ONLY
2146 template<
typename T >
2148 endsWithIgnoreAsciiCase(T & literal)
const
2154 <= sal_uInt32(pData->length))
2156 (pData->buffer + pData->length
2169 template<
typename T >
2170 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
2171 endsWithIgnoreAsciiCase(T & literal, std::u16string_view * rest)
const
2174 bool b = endsWithIgnoreAsciiCase(literal);
2179 - libreoffice_internal::ConstCharArrayDetector<T>::length));
2189 template<
typename T >
2190 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
2197 <= sal_uInt32(pData->length))
2199 (pData->buffer + pData->length
2206 if (b && rest != NULL) {
2227 char const * asciiStr, sal_Int32 asciiStrLength)
const
2229 return asciiStrLength <= pData->length
2231 pData->buffer + pData->length - asciiStrLength,
2232 asciiStrLength, asciiStr, asciiStrLength)
2237 {
return rStr1.
equals(rStr2); }
2240 {
return !(operator == ( rStr1, rStr2 )); }
2243 {
return rStr1.
compareTo( rStr2 ) < 0; }
2245 {
return rStr1.
compareTo( rStr2 ) > 0; }
2247 {
return rStr1.
compareTo( rStr2 ) <= 0; }
2249 {
return rStr1.
compareTo( rStr2 ) >= 0; }
2251#if defined LIBO_INTERNAL_ONLY
2254 operator ==(
OUString const & s1, T
const & s2) {
2259 template<
typename T>
2260 friend typename libreoffice_internal::NonConstCharArrayDetector<T, bool>::TypeUtf16
2261 operator ==(OUString
const & s1, T & s2) {
2266 template<
typename T>
friend typename libreoffice_internal::CharPtrDetector<T, bool>::TypeUtf16
2267 operator ==(T
const & s1, OUString
const & s2) {
2272 template<
typename T>
2273 friend typename libreoffice_internal::NonConstCharArrayDetector<T, bool>::TypeUtf16
2274 operator ==(T & s1, OUString
const & s2) {
2279 template<
typename T>
friend typename libreoffice_internal::CharPtrDetector<T, bool>::TypeUtf16
2280 operator !=(OUString
const & s1, T
const & s2) {
return !(s1 == s2); }
2282 template<
typename T>
2283 friend typename libreoffice_internal::NonConstCharArrayDetector<T, bool>::TypeUtf16
2284 operator !=(OUString
const & s1, T & s2) {
return !(s1 == s2); }
2286 template<
typename T>
friend typename libreoffice_internal::CharPtrDetector<T, bool>::TypeUtf16
2287 operator !=(T
const & s1, OUString
const & s2) {
return !(s1 == s2); }
2289 template<
typename T>
2290 friend typename libreoffice_internal::NonConstCharArrayDetector<T, bool>::TypeUtf16
2291 operator !=(T & s1, OUString
const & s2) {
return !(s1 == s2); }
2296 {
return rStr1.
compareTo( pStr2 ) == 0; }
2298 {
return OUString( pStr1 ).compareTo( rStr2 ) == 0; }
2301 {
return !(operator == ( rStr1, pStr2 )); }
2303 {
return !(operator == ( pStr1, rStr2 )); }
2314 template<
typename T >
2330 template<
typename T >
2346 template<
typename T >
2362 template<
typename T >
2372#if defined LIBO_INTERNAL_ONLY
2375 operator ==(
OUString const &
string, T & literal) {
2378 string.pData->buffer,
string.pData->length,
2385 template<
typename T>
friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
2386 operator ==(T & literal, OUString
const &
string) {
2389 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
2391 libreoffice_internal::ConstCharArrayDetector<T>::length,
2392 string.pData->buffer,
string.pData->length)
2396 template<
typename T>
friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
2397 operator !=(OUString
const &
string, T & literal) {
2400 string.pData->buffer,
string.pData->length,
2401 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
2403 libreoffice_internal::ConstCharArrayDetector<T>::length)
2407 template<
typename T>
friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
2408 operator !=(T & literal, OUString
const &
string) {
2411 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
2413 libreoffice_internal::ConstCharArrayDetector<T>::length,
2414 string.pData->buffer,
string.pData->length)
2446 assert(fromIndex >= 0);
2448 return (ret < 0 ? ret : ret+fromIndex);
2497#if defined LIBO_INTERNAL_ONLY
2498 sal_Int32 indexOf(std::u16string_view sv, sal_Int32 fromIndex = 0)
const {
2499 assert(fromIndex >= 0);
2501 pData->buffer + fromIndex, pData->length - fromIndex, sv.data(), sv.size());
2502 return n < 0 ? n : n + fromIndex;
2507 assert(fromIndex >= 0);
2509 str.pData->buffer, str.pData->length );
2510 return (ret < 0 ? ret : ret+fromIndex);
2519 template<
typename T >
2524 assert(fromIndex >= 0);
2526 pData->buffer + fromIndex, pData->length - fromIndex,
2529 return n < 0 ? n : n + fromIndex;
2556 char const * str, sal_Int32 len, sal_Int32 fromIndex = 0)
const
2558 assert(fromIndex >= 0);
2560 pData->buffer + fromIndex, pData->length - fromIndex, str, len);
2561 return ret < 0 ? ret : ret + fromIndex;
2568#if SAL_TYPES_SIZEOFLONG == 8
2587#if defined LIBO_INTERNAL_ONLY
2588 sal_Int32 lastIndexOf(std::u16string_view sv)
const {
2590 pData->buffer, pData->length, sv.data(), sv.size());
2596 str.pData->buffer, str.pData->length );
2617#if defined LIBO_INTERNAL_ONLY
2618 sal_Int32 lastIndexOf(std::u16string_view sv, sal_Int32 fromIndex)
const {
2625 str.pData->buffer, str.pData->length );
2634 template<
typename T >
2640 pData->buffer, pData->length,
2667 pData->buffer, pData->length, str, len);
2699 rtl_uString *pNew = NULL;
2704#if defined LIBO_INTERNAL_ONLY
2717 assert(beginIndex >= 0);
2718 assert(beginIndex <= getLength());
2719 return subView(beginIndex, getLength() - beginIndex);
2736 assert(beginIndex >= 0);
2738 assert(beginIndex <= getLength());
2739 assert(count <= getLength() - beginIndex);
2740 return std::u16string_view(*this).substr(beginIndex, count);
2744#ifndef LIBO_INTERNAL_ONLY
2755 rtl_uString* pNew = NULL;
2761#ifndef LIBO_INTERNAL_ONLY
2764 return rStr1.
concat( rStr2 );
2783 rtl_uString* pNew = NULL;
2788#ifdef LIBO_INTERNAL_ONLY
2791 rtl_uString* pNew = NULL;
2792 rtl_uString_newReplaceStrAtUtf16L( &pNew, pData, index, count, newStr.data(), newStr.size() );
2796 template <std::
size_t N>
2799 return replaceAt(index, count, std::u16string_view(newStr, N - 1));
2801 template <
class T, std::enable_if_t<std::is_convertible_v<T, std::u16
string_view>,
int> = 0>
2804 return replaceAt(index, count, std::u16string_view(newStr));
2823 rtl_uString* pNew = NULL;
2846#if defined LIBO_INTERNAL_ONLY
2847 [[nodiscard]]
OUString replaceFirst(
2848 std::u16string_view from, std::u16string_view to, sal_Int32 * index =
nullptr)
const
2850 rtl_uString * s =
nullptr;
2853 &s, pData, from.data(), from.size(), to.data(), to.size(),
2854 index ==
nullptr ? &i : index);
2859 OUString const & from,
OUString const & to, sal_Int32 * index = NULL)
const
2861 rtl_uString * s = NULL;
2864 &s, pData, from.pData, to.pData, index == NULL ? &i : index);
2887#if defined LIBO_INTERNAL_ONLY
2888 template<
typename T> [[nodiscard]]
2890 T & from, std::u16string_view to, sal_Int32 * index =
nullptr)
const
2893 rtl_uString * s =
nullptr;
2898 index ==
nullptr ? &i : index);
2902 template<
typename T >
2904 sal_Int32 * index = NULL)
const
2907 rtl_uString * s = NULL;
2913 index == NULL ? &i : index);
2936#if defined LIBO_INTERNAL_ONLY
2937 template<
typename T> [[nodiscard]]
2939 std::u16string_view from, T & to, sal_Int32 * index =
nullptr)
const
2942 rtl_uString * s =
nullptr;
2945 &s, pData, from.data(), from.size(),
2951 template<
typename T >
2953 sal_Int32 * index = NULL)
const
2956 rtl_uString * s = NULL;
2959 &s, pData, from.pData,
2962 index == NULL ? &i : index);
2985 template<
typename T1,
typename T2 >
2991 rtl_uString * s = NULL;
2999 index == NULL ? &i : index);
3018#if defined LIBO_INTERNAL_ONLY
3020 std::u16string_view from, std::u16string_view to, sal_Int32 fromIndex = 0)
const
3022 rtl_uString * s =
nullptr;
3023 rtl_uString_newReplaceAllFromIndexUtf16LUtf16L(
3024 &s, pData, from.data(), from.size(), to.data(), to.size(), fromIndex);
3031 rtl_uString * s = NULL;
3050#if defined LIBO_INTERNAL_ONLY
3051 template<
typename T> [[nodiscard]]
3053 T & from, std::u16string_view to)
const
3056 rtl_uString * s =
nullptr;
3063 template<
typename T >
3067 rtl_uString * s = NULL;
3089#if defined LIBO_INTERNAL_ONLY
3090 template<
typename T> [[nodiscard]]
3092 std::u16string_view from, T & to)
const
3095 rtl_uString * s =
nullptr;
3097 &s, pData, from.data(), from.size(),
3103 template<
typename T >
3107 rtl_uString * s = NULL;
3109 &s, pData, from.pData,
3129 template<
typename T1,
typename T2 >
3135 rtl_uString * s = NULL;
3157 rtl_uString* pNew = NULL;
3174 rtl_uString* pNew = NULL;
3194 rtl_uString* pNew = NULL;
3225 rtl_uString * pNew = NULL;
3245 return getToken(count, separator, n);
3269 return pData->buffer[0];
3380 rtl_uString * pNew = NULL;
3383 throw std::bad_alloc();
3416 sal_uInt32 *pInfo = NULL )
3418 rtl_uString * pNew = NULL;
3420 convertFlags, pInfo );
3422 throw std::bad_alloc();
3452 sal_uInt32 nFlags)
const
3455 pData->length, nEncoding, nFlags);
3510 sal_Int32 * indexUtf16, sal_Int32 incrementCodePoints = 1)
const
3513 pData, indexUtf16, incrementCodePoints);
3525#if defined LIBO_INTERNAL_ONLY
3526 static OUString fromUtf8(std::string_view rSource)
3576#ifdef LIBO_INTERNAL_ONLY
3578 static auto number(
int i, sal_Int16 radix = 10 )
3582 static auto number(
long long ll, sal_Int16 radix = 10 )
3586 static auto number(
unsigned long long ll, sal_Int16 radix = 10 )
3590 static auto number(
unsigned int i, sal_Int16 radix = 10 )
3592 return number(
static_cast< unsigned long long >( i ), radix );
3594 static auto number(
long i, sal_Int16 radix = 10)
3596 return number(
static_cast< long long >( i ), radix );
3598 static auto number(
unsigned long i, sal_Int16 radix = 10 )
3600 return number(
static_cast< unsigned long long >( i ), radix );
3622 return number(
static_cast< unsigned long long >( i ), radix );
3628 return number(
static_cast< long long >( i ), radix );
3634 return number(
static_cast< unsigned long long >( i ), radix );
3663 rtl_uString* pNew = NULL;
3669 throw std::bad_alloc();
3685 rtl_uString* pNew = NULL;
3691 throw std::bad_alloc();
3696#ifdef LIBO_INTERNAL_ONLY
3697 static auto boolean(
bool b)
3760 return number( i, radix );
3775 return number( ll, radix );
3823 rtl_uString* pNew = NULL;
3828#if defined LIBO_INTERNAL_ONLY
3829 static OUString createFromAscii(std::string_view value) {
3830 rtl_uString * p =
nullptr;
3836#if defined LIBO_INTERNAL_ONLY
3837 operator std::u16string_view()
const {
return {getStr(), sal_uInt32(getLength())}; }
3840#if defined LIBO_INTERNAL_ONLY
3851 template<
typename T> [[nodiscard]]
static
3852 OUStringConcat<OUStringConcatMarker, T>
3853 Concat(T
const & value) {
return OUStringConcat<OUStringConcatMarker, T>(value); }
3858 template<
typename T, std::
size_t N> [[nodiscard]]
static
3859 OUStringConcat<OUStringConcatMarker, T[N]>
3860 Concat(T (& value)[N]) {
return OUStringConcat<OUStringConcatMarker, T[N]>(value); }
3864 OUString & internalAppend( rtl_uString* pOtherData )
3866 rtl_uString* pNewData = NULL;
3868 if (pNewData == NULL) {
3869 throw std::bad_alloc();
3876#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
3877 static constexpr auto empty = OUStringLiteral(u
"");
3881#if defined LIBO_INTERNAL_ONLY
3887void operator ==(
OUString const &, std::nullptr_t) =
delete;
3888void operator ==(std::nullptr_t,
OUString const &) =
delete;
3889void operator !=(
OUString const &, std::nullptr_t) =
delete;
3890void operator !=(std::nullptr_t,
OUString const &) =
delete;
3893#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
3894inline bool operator ==(
OUString const & lhs, StringConcatenation<char16_t>
const & rhs)
3895{
return lhs == std::u16string_view(rhs); }
3896inline bool operator !=(
OUString const & lhs, StringConcatenation<char16_t>
const & rhs)
3897{
return lhs != std::u16string_view(rhs); }
3898inline bool operator ==(StringConcatenation<char16_t>
const & lhs,
OUString const & rhs)
3899{
return std::u16string_view(lhs) == rhs; }
3900inline bool operator !=(StringConcatenation<char16_t>
const & lhs,
OUString const & rhs)
3901{
return std::u16string_view(lhs) != rhs; }
3904#if defined LIBO_INTERNAL_ONLY
3913 static std::size_t length(
const OUString& s ) {
return s.
getLength(); }
3914 sal_Unicode* operator() (
sal_Unicode* buffer,
const OUString& s )
const {
return addDataHelper( buffer, s.getStr(), s.getLength()); }
3920template<std::
size_t N>
3921struct ToStringHelper< OUStringLiteral<N> >
3923 static std::size_t length(
const OUStringLiteral<N>& str ) {
return str.getLength(); }
3924 sal_Unicode* operator()(
sal_Unicode* buffer,
const OUStringLiteral<N>& str )
const {
return addDataHelper( buffer, str.getStr(), str.getLength() ); }
3930template<
typename charT,
typename traits,
typename T1,
typename T2 >
3931inline std::basic_ostream<charT, traits> &
operator <<(
3932 std::basic_ostream<charT, traits> & stream, OUStringConcat< T1, T2 >&& concat)
3934 return stream <<
OUString( std::move(concat) );
3957 {
return static_cast<size_t>(rString.
hashCode()); }
3979#if defined LIBO_INTERNAL_ONLY
3984 return OUString( rStr.data(), rStr.length(), encoding, convertFlags );
4012#if defined LIBO_INTERNAL_ONLY
4017 return OString( rUnicode.data(), rUnicode.length(), encoding, convertFlags );
4038template<
typename charT,
typename traits >
4039inline std::basic_ostream<charT, traits> &
operator <<(
4040 std::basic_ostream<charT, traits> & stream, OUString
const & rString)
4050#ifdef RTL_STRING_UNITTEST
4053typedef rtlunittest::OUString
OUString;
4060#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
4065using ::rtl::OUStringLiteral;
4066using ::rtl::OUStringChar;
4067using ::rtl::Concat2View;
4068using RepeatedUChar = ::rtl::RepeatedChar_t<sal_Unicode>;
4071#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
4074#if defined RTL_STRING_UNITTEST
4079#if defined RTL_STRING_UNITTEST
4083operator ""_ustr() {
return L; }
4093#if defined LIBO_INTERNAL_ONLY
4097struct hash<::rtl::OUString>
4099 std::size_t operator()(::rtl::OUString
const & s)
const
4101 if constexpr (
sizeof(std::size_t) == 8)
4105 for (sal_Int32 i = 0, len = s.
getLength(); i < len; ++i)
4116#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
4123static inline constexpr ::rtl::OUString EMPTY_OUSTRING = u
""_ustr;
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition types.h:492
__sal_NoAcquire
Definition types.h:371
@ SAL_NO_ACQUIRE
definition of a no acquire enum for ctors
Definition types.h:374
unsigned char sal_Bool
Definition types.h:38
#define SAL_CONSTEXPR
C++11 "constexpr" feature.
Definition types.h:422
sal_uInt16 sal_Unicode
Definition types.h:123
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be used.
Definition types.h:288
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition types.h:611
#define SAL_N_ELEMENTS(arr)
Definition macros.h:51
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_DLLPUBLIC void rtl_uString_assign(rtl_uString **str, rtl_uString *rightValue) SAL_THROW_EXTERN_C()
Assign a new value to a string.
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 float rtl_ustr_toFloat(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a float.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_shortenedCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const char *second, sal_Int32 shortenedLen) SAL_THROW_EXTERN_C()
Compare two strings with a maximum count of characters.
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:2180
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition ustring.h:1026
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_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.
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_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 sal_Int32 rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const 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 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.
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition ustring.h:1045
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_Bool rtl_ustr_asciil_reverseEquals_WithLength(const sal_Unicode *first, const char *second, sal_Int32 len) SAL_THROW_EXTERN_C()
Compare two strings from back to front for equality.
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
SAL_DLLPUBLIC void rtl_uString_newReplaceAllAsciiLUtf16L(rtl_uString **newStr, rtl_uString *str, char const *from, sal_Int32 fromLength, sal_Unicode const *to, sal_Int32 toLength) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
SAL_DLLPUBLIC double rtl_ustr_toDouble(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a double.
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_newReplaceFirstToAsciiL(rtl_uString **newStr, rtl_uString *str, rtl_uString const *from, char const *to, sal_Int32 toLength, sal_Int32 *index) SAL_THROW_EXTERN_C()
Create a new string by replacing the first occurrence of a given substring with another substring.
SAL_DLLPUBLIC 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.
#define RTL_USTR_MAX_VALUEOFINT64
Definition ustring.h:984
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const char *second) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
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_DLLPUBLIC void rtl_uString_internConvert(rtl_uString **newStr, const 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_DLLPUBLIC void rtl_uString_acquire(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Increment the reference count of a string.
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.
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.
#define RTL_USTR_MAX_VALUEOFUINT64
Definition ustring.h:1007
SAL_DLLPUBLIC sal_Bool rtl_convertStringToUString(rtl_uString **target, char const *source, sal_Int32 length, rtl_TextEncoding encoding, sal_uInt32 flags) SAL_THROW_EXTERN_C()
Converts a byte string to a Unicode string, signalling failure.
SAL_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_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_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_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.
SAL_DLLPUBLIC void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_getLength(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Return the length of a string.
SAL_DLLPUBLIC void rtl_uString_newFromAscii(rtl_uString **newStr, const char *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.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfAscii_WithLength(sal_Unicode const *str, sal_Int32 len, char const *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the last occurrence of an ASCII substring within a string.
SAL_DLLPUBLIC void rtl_uString_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_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 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_uInt64 rtl_ustr_toUInt64(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an unsigned long integer.
SAL_DLLPUBLIC void rtl_uString_newReplaceAllUtf16LAsciiL(rtl_uString **newStr, rtl_uString *str, sal_Unicode const *from, sal_Int32 fromLength, char const *to, sal_Int32 toLength) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
SAL_DLLPUBLIC 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_DLLPUBLIC void rtl_uString_newTrim(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Create a new string by removing white space from both ends of another string.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfChar_WithLength(const sal_Unicode *str, sal_Int32 len, sal_Unicode ch) SAL_THROW_EXTERN_C()
Search for the last occurrence of a character within a string.
SAL_DLLPUBLIC 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_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_intern(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Return a canonical representation for a string.
SAL_DLLPUBLIC void rtl_string2UString(rtl_uString **newStr, const 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_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_asciil_reverseCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const char *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings from back to front.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const char *second) SAL_THROW_EXTERN_C()
Compare two strings.
#define RTL_USTR_MAX_VALUEOFBOOLEAN
Definition ustring.h:919
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_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 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_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_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 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_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_valueOfInt32(sal_Unicode *str, sal_Int32 i, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an integer.
SAL_DLLPUBLIC sal_Bool rtl_ustr_toBoolean(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a boolean.
SAL_DLLPUBLIC void rtl_uString_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_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_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_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.
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_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_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_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_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.
#define RTL_USTR_MAX_VALUEOFINT32
Definition ustring.h:961
#define RTL_TEXTENCODING_UTF8
Definition textenc.h:117
sal_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition textenc.h:37
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 OUSTRING_TO_OSTRING_CVTFLAGS
Definition string.h:1350
SAL_DLLPUBLIC void rtl_math_doubleToUString(rtl_uString **pResult, sal_Int32 *pResultCapacity, sal_Int32 nResultOffset, double fValue, enum rtl_math_StringFormat eFormat, sal_Int32 nDecPlaces, sal_Unicode cDecSeparator, sal_Int32 const *pGroups, sal_Unicode cGroupSeparator, sal_Bool bEraseTrailingDecZeros) SAL_THROW_EXTERN_C()
Conversions analogous to sprintf() using internal rounding.
@ rtl_math_StringFormat_G
Like sprintf() G, 'F' or 'E' format is used depending on which one is more compact.
Definition math.h:53
#define RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
Definition textcvt.h:151
#define RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
Definition textcvt.h:75
#define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
Definition textcvt.h:72
#define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
Definition textcvt.h:68
#define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
Definition textcvt.h:145
sal_Int32 oslInterlockedCount
Definition interlck.h:44
Definition bootstrap.hxx:34
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:2834
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:3987
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:4020
Definition stringutils.hxx:119
This String class provide base functionality for C++ like 8-Bit character array handling.
Definition string.hxx:193
const char * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the characters of this string.
Definition string.hxx:697
sal_Int32 getLength() const
Returns the length of this string.
Definition string.hxx:671
Definition stringutils.hxx:178
Definition stringutils.hxx:181
Definition stringutils.hxx:233
A string buffer implements a mutable sequence of characters.
Definition ustrbuf.hxx:73
This String class provides base functionality for C++ like Unicode character array handling.
Definition ustring.hxx:168
static OUString number(int i, sal_Int16 radix=10)
Returns the string representation of the integer argument.
Definition ustring.hxx:3613
OUString intern() const
Return a canonical representation for a string.
Definition ustring.hxx:3378
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:2520
bool startsWith(sal_Unicode ch) const
Check whether this string starts with a given character.
Definition ustring.hxx:1630
bool startsWith(sal_Unicode ch, OUString *rest) const
Check whether this string starts with a given character.
Definition ustring.hxx:1647
bool endsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string ends with a given substring.
Definition ustring.hxx:1878
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:2226
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:3155
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:3064
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition ustring.hxx:845
bool equalsIgnoreAsciiCase(const OUString &str) const
Perform an ASCII lowercase comparison of two strings.
Definition ustring.hxx:1005
bool endsWithAsciiL(char const *asciiStr, sal_Int32 asciiStrLength) const
Check whether this string ends with a given ASCII string.
Definition ustring.hxx:2041
OUString(const OUString &str)
New string from OUString.
Definition ustring.hxx:197
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:3509
static OUString fromUtf8(const OString &rSource)
Convert an OString to an OUString, assuming that the OString is UTF-8-encoded.
Definition ustring.hxx:3539
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:1103
sal_Int32 toInt32(sal_Int16 radix=10) const
Returns the int32 value from this string.
Definition ustring.hxx:3282
void clear()
Clears the string, i.e, makes a zero-character string.
Definition ustring.hxx:810
bool equalsIgnoreAsciiCaseAsciiL(const char *asciiStr, sal_Int32 asciiStrLength) const
Perform an ASCII lowercase comparison of two strings.
Definition ustring.hxx:1376
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:3645
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:2555
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T1, typenamelibreoffice_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:3131
~OUString()
Release the string data.
Definition ustring.hxx:536
sal_Int32 compareTo(const OUString &str, sal_Int32 maxLength) const
Compares two strings with a maximum count of characters.
Definition ustring.hxx:910
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:2664
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:2444
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:3104
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:3638
bool matchAsciiL(const char *asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition ustring.hxx:1404
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:3028
float toFloat() const
Returns the float value from this string.
Definition ustring.hxx:3344
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:3632
static OUString createFromAscii(const char *value)
Returns an OUString copied without conversion from an ASCII character string.
Definition ustring.hxx:3821
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:2903
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T1, typenamelibreoffice_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:2987
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:2821
sal_Int32 hashCode() const
Returns a hashcode for this string.
Definition ustring.hxx:2426
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:948
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition ustring.hxx:2331
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition ustring.hxx:2315
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:3626
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:1050
sal_uInt64 toUInt64(sal_Int16 radix=10) const
Returns the uint64 value from this string.
Definition ustring.hxx:3331
bool matchIgnoreAsciiCaseAsciiL(const 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:1442
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:1798
OString toUtf8() const
Convert this string to an OString, assuming that the string can be UTF-8-encoded successfully.
Definition ustring.hxx:3563
sal_Int32 reverseCompareToAsciiL(const char *asciiStr, sal_Int32 asciiStrLength) const
Compares two strings in reverse order.
Definition ustring.hxx:1238
bool equalsAsciiL(const char *asciiStr, sal_Int32 asciiStrLength) const
Perform a comparison of two strings.
Definition ustring.hxx:1281
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:3620
bool endsWith(sal_Unicode ch) const
Check whether this string ends with a given character.
Definition ustring.hxx:1897
bool convertToString(OString *pTarget, rtl_TextEncoding nEncoding, sal_uInt32 nFlags) const
Converts to an OString, signalling failure.
Definition ustring.hxx:3451
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:1600
OUString(rtl_uString *str)
New string from OUString data.
Definition ustring.hxx:249
OUString(const sal_Unicode *value, sal_Int32 length)
New string from a Unicode character buffer array.
Definition ustring.hxx:335
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:2130
sal_Int32 compareTo(const OUString &str) const
Compares two strings.
Definition ustring.hxx:881
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition ustring.hxx:2347
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:621
bool startsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string starts with a given substring.
Definition ustring.hxx:1530
sal_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition ustring.hxx:2460
sal_Int32 compareToIgnoreAsciiCaseAscii(const char *asciiStr) const
Compares two ASCII strings ignoring case.
Definition ustring.hxx:1340
bool endsWith(sal_Unicode ch, OUString *rest) const
Check whether this string ends with a given character.
Definition ustring.hxx:1914
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:2952
OUString(sal_Unicode value)
New string from a single Unicode character.
Definition ustring.hxx:278
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:2858
sal_Int64 toInt64(sal_Int16 radix=10) const
Returns the int64 value from this string.
Definition ustring.hxx:3314
sal_uInt32 toUInt32(sal_Int16 radix=10) const
Returns the uint32 value from this string.
Definition ustring.hxx:3299
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:1722
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:2622
static OUString const & unacquired(rtl_uString *const *ppHandle)
Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
Definition ustring.hxx:562
double toDouble() const
Returns the double value from this string.
Definition ustring.hxx:3357
bool equalsAscii(const char *asciiStr) const
Perform a comparison of two strings.
Definition ustring.hxx:1259
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:1160
OUString getToken(sal_Int32 token, sal_Unicode cTok, sal_Int32 &index) const
Returns a token in the string.
Definition ustring.hxx:3223
sal_Int32 getLength() const
Returns the length of this string.
Definition ustring.hxx:823
bool equalsIgnoreAsciiCaseAscii(const char *asciiStr) const
Perform an ASCII lowercase comparison of two strings.
Definition ustring.hxx:1308
OUString()
New string containing no characters.
Definition ustring.hxx:180
OUString(const sal_Unicode *value)
New string from a Unicode character buffer array.
Definition ustring.hxx:319
OUString(const 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:455
OUString & operator=(const OUString &str)
Assign a new string.
Definition ustring.hxx:586
static OUString number(float f)
Returns the string representation of the float argument.
Definition ustring.hxx:3661
static OUString valueOf(sal_Bool b)
Returns the string representation of the sal_Bool argument.
Definition ustring.hxx:3713
bool isEmpty() const
Checks if a string is empty.
Definition ustring.hxx:833
sal_Int32 compareToIgnoreAsciiCase(const OUString &str) const
Perform an ASCII lowercase comparison of two strings.
Definition ustring.hxx:1037
OUString(sal_uInt32 const *codePoints, sal_Int32 codePointCount)
Create a new string from an array of Unicode code points.
Definition ustring.hxx:482
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:2007
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition ustring.hxx:694
sal_Unicode toChar() const
Returns the first character from this string.
Definition ustring.hxx:3267
OUString getToken(sal_Int32 count, sal_Unicode separator) const
Returns a token from the string.
Definition ustring.hxx:3243
static OUString boolean(bool b)
Returns the string representation of the boolean argument.
Definition ustring.hxx:3729
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:2635
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:2697
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:2191
OUString(rtl_uString *str, __sal_NoAcquire)
New OUString from OUString data without acquiring it.
Definition ustring.hxx:270
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:2477
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:3192
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:3172
SAL_WARN_UNUSED_RESULT OUString concat(const OUString &str) const
Concatenates the specified string to the end of this string.
Definition ustring.hxx:2753
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:2781
bool match(const OUString &str, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition ustring.hxx:1089
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:1145
sal_Int32 compareToAscii(const char *asciiStr) const
Compares two strings.
Definition ustring.hxx:1185
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:357
sal_Int32 reverseCompareTo(const OUString &str) const
Compares two strings in reverse order.
Definition ustring.hxx:935
static OUString number(double d)
Returns the string representation of the double argument.
Definition ustring.hxx:3683
friend OUString operator+(const OUString &rStr1, const OUString &rStr2)
Definition ustring.hxx:2762
SAL_WARN_UNUSED_RESULT OUString copy(sal_Int32 beginIndex) const
Returns a new string that is a substring of this string.
Definition ustring.hxx:2680
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition ustring.hxx:2363
bool equals(const OUString &str) const
Perform a comparison of two strings.
Definition ustring.hxx:969
sal_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition ustring.hxx:2593
bool toBoolean() const
Returns the Boolean value from this string.
Definition ustring.hxx:3256
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:2505
static OUString intern(const 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:3413
A helper to use OUStrings with hash maps.
Definition ustring.hxx:3946
size_t operator()(const OUString &rString) const
Compute a hash code for a string.
Definition ustring.hxx:3956