24#ifndef INCLUDED_RTL_STRING_HXX
25#define INCLUDED_RTL_STRING_HXX
38#if defined LIBO_INTERNAL_ONLY
49#ifdef LIBO_INTERNAL_ONLY
50#include "config_global.h"
51#include "rtl/stringconcat.hxx"
54#ifdef RTL_STRING_UNITTEST
55extern bool rtl_string_unittest_const_literal;
56extern bool rtl_string_unittest_const_literal_function;
64#ifdef RTL_STRING_UNITTEST
65#define rtl rtlunittest
72#ifdef RTL_STRING_UNITTEST
75#define RTL_STRING_CONST_FUNCTION rtl_string_unittest_const_literal_function = true;
77#define RTL_STRING_CONST_FUNCTION
81#ifdef LIBO_INTERNAL_ONLY
90 static_assert(N != 0);
91 static_assert(N - 1 <= std::numeric_limits<sal_Int32>::max(),
"literal too long");
99 OStringLiteral(
char const (&literal)[N]) {
101 assert(literal[N - 1] ==
'\0');
102 std::copy_n(literal, N, more.buffer);
105#if !(defined _MSC_VER && _MSC_VER >= 1930 && _MSC_VER <= 1939 && defined _MANAGED)
106#if HAVE_CPP_CONSTEVAL
111 OStringLiteral(
char8_t const (&literal)[N]) {
113 assert(literal[N - 1] ==
'\0');
114 std::copy_n(literal, N, more.buffer);
118 constexpr sal_Int32 getLength()
const {
return more.length; }
120 constexpr char const * getStr() const SAL_RETURNS_NONNULL {
return more.buffer; }
122 constexpr operator std::string_view()
const {
return {more.buffer, sal_uInt32(more.length)}; }
125 static constexpr void assertLayout() {
128 static_assert(std::is_standard_layout_v<OStringLiteral>);
129 static_assert(offsetof(OStringLiteral, str.refCount) == offsetof(OStringLiteral, more.refCount));
130 static_assert(offsetof(OStringLiteral, str.length) == offsetof(OStringLiteral, more.length));
131 static_assert(offsetof(OStringLiteral, str.buffer) == offsetof(OStringLiteral, more.buffer));
138 sal_Int32 length = N - 1;
151#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
155template<OStringLiteral L>
struct OStringHolder {
156 static constexpr auto & literal = L;
213#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
219#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
220 if (std::is_constant_evaluated()) {
232#if defined LIBO_INTERNAL_ONLY
233#if !defined(__COVERITY__)
240#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
246#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
247 if (std::is_constant_evaluated()) {
297#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST_CONCAT
311 template<
typename T >
318 template<
typename T >
325#if __cplusplus > 202002L
326 template<
typename T >
344 template<
typename T >
359#ifdef RTL_STRING_UNITTEST
360 rtl_string_unittest_const_literal =
true;
372 OString(
const char * value, sal_Int32 length )
378#ifdef LIBO_INTERNAL_ONLY
385 template<std::
size_t N>
constexpr OString(OStringLiteral<N>
const & literal):
386 pData(const_cast<rtl_String *>(&literal.str)) {}
387 template<std::
size_t N> OString(OStringLiteral<N> &&) =
delete;
391#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
393 template<OStringLiteral L>
constexpr OString(detail::OStringHolder<L>
const & holder):
394 pData(const_cast<rtl_String *>(&holder.literal.str)) {}
397#if defined LIBO_INTERNAL_ONLY
398 explicit OString(std::string_view sv) {
399 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
400 throw std::bad_alloc();
428 throw std::bad_alloc();
432#ifdef LIBO_INTERNAL_ONLY
437 template<
typename T1,
typename T2 >
438 OString( OStringConcat< T1, T2 >&& c )
440 const sal_Int32 l = c.length();
444 char* end = c.addData( pData->buffer );
454 template< std::
size_t N >
455 OString( OStringNumber< N >&& n )
456 : OString( n.buf, n.length )
460#ifdef LIBO_INTERNAL_ONLY
461 OString(std::nullptr_t) =
delete;
467#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
472#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
473 if (std::is_constant_evaluated()) {
485#if defined LIBO_INTERNAL_ONLY
497 static OString const & unacquired( rtl_String *
const * ppHandle )
498 {
return *
reinterpret_cast< OString const *
>( ppHandle ); }
512#if defined LIBO_INTERNAL_ONLY
513#if !defined(__COVERITY__)
536 template<
typename T >
539 RTL_STRING_CONST_FUNCTION
560#if defined LIBO_INTERNAL_ONLY
567#if defined LIBO_INTERNAL_ONLY
568 void operator+=(
OString const &) && =
delete;
571#if defined LIBO_INTERNAL_ONLY
573 operator +=(T
const & value) & {
return operator +=(std::string_view(value)); }
574 template<
typename T>
typename libreoffice_internal::CharPtrDetector<T, OString &>::Type
575 operator +=(T
const &) && =
delete;
578 typename libreoffice_internal::NonConstCharArrayDetector<T, OString &>::Type
579 operator +=(T & value) & {
return operator +=(std::string_view(value)); }
581 typename libreoffice_internal::NonConstCharArrayDetector<T, OString &>::Type operator +=(T &) &&
584 template<
typename T>
typename libreoffice_internal::ConstCharArrayDetector<T, OString &>::Type
585 operator +=(T & literal) & {
586 assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal));
589 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
590 libreoffice_internal::ConstCharArrayDetector<T>::length));
592 template<
typename T>
typename libreoffice_internal::ConstCharArrayDetector<T, OString &>::Type
593 operator +=(T &) && =
delete;
595 template<std::
size_t N> OString & operator +=(OStringLiteral<N>
const & literal) &
596 {
return operator +=(std::string_view(literal.getStr(), literal.getLength())); }
597 template<std::
size_t N>
void operator +=(OStringLiteral<N>
const &) && =
delete;
599 OString & operator +=(std::string_view sv) & {
603 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max() - pData->length)) {
604 throw std::bad_alloc();
606 auto const l = pData->length + sv.size();
608 *addDataHelper(pData->buffer + pData->length, sv.data(), sv.size()) =
'\0';
612 void operator +=(std::string_view) && =
delete;
615#ifdef LIBO_INTERNAL_ONLY
620 template<
typename T1,
typename T2 >
621 OString& operator+=( OStringConcat< T1, T2 >&& c ) & {
622 sal_Int32 l = c.length();
627 char* end = c.addData( pData->buffer + pData->length );
632 template<
typename T1,
typename T2>
void operator +=(
633 OStringConcat<T1, T2> &&) && =
delete;
639 template< std::
size_t N >
640 OString& operator+=( OStringNumber< N >&& n ) & {
641 return operator +=(std::string_view(n.buf, n.length));
643 template<std::
size_t N>
void operator +=(
644 OStringNumber<N> &&) && =
delete;
676 return pData->length == 0;
690 const char *
getStr() const SAL_RETURNS_NONNULL {
return pData->buffer; }
701 char operator [](sal_Int32 index)
const {
703 assert(index >= 0 &&
static_cast<sal_uInt32
>(index) <
static_cast<sal_uInt32
>(
getLength()));
722 str.pData->buffer, str.pData->length );
741 rObj.pData->buffer, rObj.pData->length, maxLength );
759 str.pData->buffer, str.pData->length );
775 if ( pData->length != str.pData->length )
777 if ( pData == str.pData )
780 str.pData->buffer, str.pData->length ) == 0;
797 bool equalsL(
const char* value, sal_Int32 length )
const
799 if ( pData->length != length )
803 value, length ) == 0;
820#if defined LIBO_INTERNAL_ONLY
821 bool equalsIgnoreAsciiCase( std::string_view str )
const
823 if ( sal_uInt32(pData->length) != str.size() )
825 if ( pData->buffer == str.data() )
828 str.data(), str.size() ) == 0;
833 if ( pData->length != str.pData->length )
835 if ( pData == str.pData )
838 str.pData->buffer, str.pData->length ) == 0;
863 template<
typename T >
869 template<
typename T >
880 template<
typename T >
883 RTL_STRING_CONST_FUNCTION
890 pData->buffer, pData->length,
918 if ( pData->length != asciiStrLength )
922 asciiStr, asciiStrLength ) == 0;
940#if defined LIBO_INTERNAL_ONLY
941 bool match( std::string_view str, sal_Int32 fromIndex = 0 )
const
943 assert(fromIndex >= 0);
945 str.data(), str.size(), str.size() ) == 0;
950 assert(fromIndex >= 0);
952 str.pData->buffer, str.pData->length, str.pData->length ) == 0;
961 template<
typename T >
964 RTL_STRING_CONST_FUNCTION
967 assert(fromIndex >= 0);
970 pData->buffer + fromIndex, pData->length - fromIndex,
995 char const * str, sal_Int32 strLength, sal_Int32 fromIndex = 0)
998 assert(fromIndex >= 0);
1000 pData->buffer + fromIndex, pData->length - fromIndex,
1001 str, strLength, strLength) == 0;
1008#if SAL_TYPES_SIZEOFLONG == 8
1030#if defined LIBO_INTERNAL_ONLY
1031 bool matchIgnoreAsciiCase( std::string_view str, sal_Int32 fromIndex = 0 )
const
1033 assert(fromIndex >= 0);
1035 str.data(), str.size(),
1041 assert(fromIndex >= 0);
1043 str.pData->buffer, str.pData->length,
1044 str.pData->length ) == 0;
1052 template<
typename T >
1055 RTL_STRING_CONST_FUNCTION
1058 assert(fromIndex >= 0);
1061 pData->buffer+fromIndex, pData->length-fromIndex,
1069#if defined LIBO_INTERNAL_ONLY
1080 bool startsWith(std::string_view str)
const {
1096 bool startsWith(std::string_view str, OString * rest)
const {
1098 bool b = startsWith(str);
1100 *rest = copy(str.size());
1117 bool startsWith(std::string_view str, std::string_view * rest)
const {
1119 bool b = startsWith(str);
1121 *rest = subView(str.size());
1141 bool b =
match(str);
1142 if (b && rest != NULL) {
1149#if defined LIBO_INTERNAL_ONLY
1155 template<
typename T >
1159 RTL_STRING_CONST_FUNCTION
1160 return match(literal, 0);
1167 template<
typename T >
1168 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWith(
1169 T & literal, OString * rest)
const
1171 RTL_STRING_CONST_FUNCTION
1173 bool b = startsWith(literal);
1176 libreoffice_internal::ConstCharArrayDetector<T>::length);
1184 template<
typename T >
1185 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWith(
1186 T & literal, std::string_view * rest)
const
1188 RTL_STRING_CONST_FUNCTION
1190 bool b = startsWith(literal);
1193 libreoffice_internal::ConstCharArrayDetector<T>::length);
1203 template<
typename T >
1205 T & literal,
OString * rest = NULL)
const
1207 RTL_STRING_CONST_FUNCTION
1208 bool b =
match(literal, 0);
1209 if (b && rest != NULL) {
1217#if defined LIBO_INTERNAL_ONLY
1234 bool startsWithIgnoreAsciiCase(std::string_view str)
1237 return matchIgnoreAsciiCase(str);
1258 bool startsWithIgnoreAsciiCase(std::string_view str, OString * rest)
1262 bool b = startsWithIgnoreAsciiCase(str);
1264 *rest = copy(str.size());
1287 bool startsWithIgnoreAsciiCase(std::string_view str, std::string_view * rest)
1291 bool b = startsWithIgnoreAsciiCase(str);
1293 *rest = subView(str.size());
1321 if (b && rest != NULL) {
1328#if defined LIBO_INTERNAL_ONLY
1334 template<
typename T >
1336 startsWithIgnoreAsciiCase(T & literal)
const
1338 RTL_STRING_CONST_FUNCTION
1341 return matchIgnoreAsciiCase(literal);
1348 template<
typename T >
1349 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
1350 startsWithIgnoreAsciiCase(T & literal, OString * rest)
const
1352 RTL_STRING_CONST_FUNCTION
1354 bool b = startsWithIgnoreAsciiCase(literal);
1357 libreoffice_internal::ConstCharArrayDetector<T>::length);
1361 template<
typename T >
1362 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
1363 startsWithIgnoreAsciiCase(T & literal, std::string_view * rest)
const
1365 RTL_STRING_CONST_FUNCTION
1367 bool b = startsWithIgnoreAsciiCase(literal);
1370 libreoffice_internal::ConstCharArrayDetector<T>::length);
1380 template<
typename T >
1381 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type
1384 RTL_STRING_CONST_FUNCTION
1388 if (b && rest != NULL) {
1396#if defined LIBO_INTERNAL_ONLY
1407 bool endsWith(std::string_view str)
const {
1408 return str.size() <= sal_uInt32(getLength())
1409 && match(str, getLength() - str.size());
1425 bool endsWith(std::string_view str, OString * rest)
const {
1427 bool b = endsWith(str);
1429 *rest = copy(0, getLength() - str.size());
1446 bool endsWith(std::string_view str, std::string_view * rest)
const {
1448 bool b = endsWith(str);
1450 *rest = subView(0, getLength() - str.size());
1472 if (b && rest != NULL) {
1479#if defined LIBO_INTERNAL_ONLY
1485 template<
typename T >
1489 RTL_STRING_CONST_FUNCTION
1494 <= sal_uInt32(getLength()))
1507 template<
typename T >
1508 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type endsWith(
1509 T & literal, OString * rest)
const
1511 RTL_STRING_CONST_FUNCTION
1513 bool b = endsWith(literal);
1518 - libreoffice_internal::ConstCharArrayDetector<T>::length));
1527 template<
typename T >
1528 typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type endsWith(
1529 T & literal, std::string_view * rest)
const
1531 RTL_STRING_CONST_FUNCTION
1533 bool b = endsWith(literal);
1538 - libreoffice_internal::ConstCharArrayDetector<T>::length));
1548 template<
typename T >
1550 T & literal,
OString * rest = NULL)
const
1552 RTL_STRING_CONST_FUNCTION
1563 if (b && rest != NULL) {
1586 bool endsWithL(
char const * str, sal_Int32 strLength)
const {
1592 {
return rStr1.
equals(rStr2); }
1594 {
return !(operator == ( rStr1, rStr2 )); }
1596 {
return rStr1.
compareTo( rStr2 ) < 0; }
1598 {
return rStr1.
compareTo( rStr2 ) > 0; }
1600 {
return rStr1.
compareTo( rStr2 ) <= 0; }
1602 {
return rStr1.
compareTo( rStr2 ) >= 0; }
1604 template<
typename T >
1613 template<
typename T >
1622 template<
typename T >
1631 template<
typename T >
1645 template<
typename T >
1648 RTL_STRING_CONST_FUNCTION
1655 rStr.pData->buffer, rStr.pData->length,
1667 template<
typename T >
1670 RTL_STRING_CONST_FUNCTION
1677 rStr.pData->buffer, rStr.pData->length,
1684 template<
typename T >
1687 return !(operator == ( rStr1, value ));
1690 template<
typename T >
1693 return !(operator == ( rStr1, value ));
1696 template<
typename T >
1699 return !(operator == ( value, rStr2 ));
1702 template<
typename T >
1705 return !(operator == ( value, rStr2 ));
1713 template<
typename T >
1716 return !( rStr == literal );
1724 template<
typename T >
1727 return !( literal == rStr );
1755 sal_Int32
indexOf(
char ch, sal_Int32 fromIndex = 0 )
const
1757 assert(fromIndex >= 0);
1759 return (ret < 0 ? ret : ret+fromIndex);
1808#if defined LIBO_INTERNAL_ONLY
1809 sal_Int32 indexOf( std::string_view str, sal_Int32 fromIndex = 0 )
const
1811 assert(fromIndex >= 0);
1813 str.data(), str.size() );
1814 return (ret < 0 ? ret : ret+fromIndex);
1819 assert(fromIndex >= 0);
1821 str.pData->buffer, str.pData->length );
1822 return (ret < 0 ? ret : ret+fromIndex);
1830 template<
typename T >
1833 RTL_STRING_CONST_FUNCTION
1836 assert(fromIndex >= 0);
1838 pData->buffer + fromIndex, pData->length - fromIndex,
1841 return n < 0 ? n : n + fromIndex;
1862 sal_Int32
indexOfL(
char const * str, sal_Int32 len, sal_Int32 fromIndex = 0)
1865 assert(fromIndex >= 0);
1867 pData->buffer + fromIndex, pData->length - fromIndex, str, len);
1868 return n < 0 ? n : n + fromIndex;
1875#if SAL_TYPES_SIZEOFLONG == 8
1894#if defined LIBO_INTERNAL_ONLY
1895 sal_Int32 lastIndexOf( std::string_view str )
const
1898 str.data(), str.size() );
1904 str.pData->buffer, str.pData->length );
1925#if defined LIBO_INTERNAL_ONLY
1926 sal_Int32 lastIndexOf( std::string_view str, sal_Int32 fromIndex )
const
1929 str.data(), str.size() );
1935 str.pData->buffer, str.pData->length );
1968 rtl_String *pNew = NULL;
1973#if defined LIBO_INTERNAL_ONLY
1986 assert(beginIndex >= 0);
1987 assert(beginIndex <= getLength());
1988 return subView(beginIndex, getLength() - beginIndex);
2005 assert(beginIndex >= 0);
2007 assert(beginIndex <= getLength());
2008 assert(count <= getLength() - beginIndex);
2009 return std::string_view(*this).substr(beginIndex, count);
2013#ifndef LIBO_INTERNAL_ONLY
2024 rtl_String* pNew = NULL;
2030#ifndef LIBO_INTERNAL_ONLY
2033 return str1.
concat( str2 );
2038#ifndef LIBO_INTERNAL_ONLY
2054 rtl_String* pNew = NULL;
2060#ifdef LIBO_INTERNAL_ONLY
2063 rtl_String* pNew = NULL;
2064 rtl_string_newReplaceStrAt_WithLength ( &pNew, pData, index, count, newStr.data(), newStr.size() );
2084 rtl_String* pNew = NULL;
2108 OString const & from,
OString const & to, sal_Int32 * index = NULL)
const
2110 rtl_String * s = NULL;
2113 &s, pData, from.pData->buffer, from.pData->length,
2114 to.pData->buffer, to.pData->length, index == NULL ? &i : index);
2132 rtl_String * s = NULL;
2134 &s, pData, from.pData->buffer, from.pData->length,
2135 to.pData->buffer, to.pData->length);
2151 rtl_String* pNew = NULL;
2168 rtl_String* pNew = NULL;
2186 rtl_String* pNew = NULL;
2217 rtl_String * pNew = NULL;
2237 return getToken(count, separator, n);
2261 return pData->buffer[0];
2354#ifdef LIBO_INTERNAL_ONLY
2356 static auto number(
int i, sal_Int16 radix = 10 )
2360 static auto number(
long long ll, sal_Int16 radix = 10 )
2364 static auto number(
unsigned long long ll, sal_Int16 radix = 10 )
2368 static auto number(
unsigned int i, sal_Int16 radix = 10 )
2370 return number(
static_cast< unsigned long long >( i ), radix );
2372 static auto number(
long i, sal_Int16 radix = 10)
2374 return number(
static_cast< long long >( i ), radix );
2376 static auto number(
unsigned long i, sal_Int16 radix = 10 )
2378 return number(
static_cast< unsigned long long >( i ), radix );
2400 return number(
static_cast< unsigned long long >( i ), radix );
2406 return number(
static_cast< long long >( i ), radix );
2412 return number(
static_cast< unsigned long long >( i ), radix );
2441 rtl_String* pNew = NULL;
2447 throw std::bad_alloc();
2463 rtl_String* pNew = NULL;
2469 throw std::bad_alloc();
2474#ifdef LIBO_INTERNAL_ONLY
2475 static auto boolean(
bool b)
2538 return number( i, radix );
2553 return number( ll, radix );
2584#if defined LIBO_INTERNAL_ONLY
2585 operator std::string_view()
const {
return {getStr(), sal_uInt32(getLength())}; }
2588#if defined LIBO_INTERNAL_ONLY
2599 template<
typename T> [[nodiscard]]
static
2600 OStringConcat<OStringConcatMarker, T>
2601 Concat(T
const & value) {
return OStringConcat<OStringConcatMarker, T>(value); }
2606 template<
typename T, std::
size_t N> [[nodiscard]]
static
2607 OStringConcat<OStringConcatMarker, T[N]>
2608 Concat(T (& value)[N]) {
return OStringConcat<OStringConcatMarker, T[N]>(value); }
2612#if defined LIBO_INTERNAL_ONLY
2613inline bool operator ==(
OString const & lhs, StringConcatenation<char>
const & rhs)
2614{
return lhs == std::string_view(rhs); }
2615inline bool operator !=(
OString const & lhs, StringConcatenation<char>
const & rhs)
2616{
return lhs != std::string_view(rhs); }
2617inline bool operator ==(StringConcatenation<char>
const & lhs,
OString const & rhs)
2618{
return std::string_view(lhs) == rhs; }
2619inline bool operator !=(StringConcatenation<char>
const & lhs,
OString const & rhs)
2620{
return std::string_view(lhs) != rhs; }
2625#ifdef LIBO_INTERNAL_ONLY
2631struct ToStringHelper<
OString >
2633 static std::size_t length(
const OString& s ) {
return s.
getLength(); }
2634 char* operator()(
char* buffer,
const OString& s )
const {
return addDataHelper( buffer, s.getStr(), s.getLength()); }
2640template<std::
size_t N>
2641struct ToStringHelper< OStringLiteral<N> >
2643 static constexpr std::size_t length(
const OStringLiteral<N>& str ) {
return str.getLength(); }
2644 char* operator()(
char* buffer,
const OStringLiteral<N>& str )
const {
return addDataHelper( buffer, str.getStr(), str.getLength() ); }
2650template<
typename charT,
typename traits,
typename T1,
typename T2 >
2651inline std::basic_ostream<charT, traits> &
operator <<(
2652 std::basic_ostream<charT, traits> & stream, OStringConcat< T1, T2 >&& concat)
2654 return stream <<
OString( std::move(concat) );
2676 {
return static_cast<size_t>(rString.
hashCode()); }
2701template<
typename charT,
typename traits > std::basic_ostream<charT, traits> &
2703 std::basic_ostream<charT, traits> & stream, OString
const & rString)
2705 return stream << rString.getStr();
2711#ifdef RTL_STRING_UNITTEST
2714typedef rtlunittest::OString
OString;
2716#undef RTL_STRING_CONST_FUNCTION
2719#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
2721using ::rtl::OStringChar;
2722using ::rtl::Concat2View;
2724using ::rtl::OStringLiteral;
2727#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
2730#if defined RTL_STRING_UNITTEST
2735#if defined RTL_STRING_UNITTEST
2739operator ""_ostr() {
return L; }
2742#if defined RTL_STRING_UNITTEST
2747#if defined RTL_STRING_UNITTEST
2752::detail::OStringHolder<L>
operator ""_tstr() {
2754#if defined RTL_STRING_UNITTEST
2759 ::detail::OStringHolder<L>();
2770#if defined LIBO_INTERNAL_ONLY
2774struct hash<::rtl::OString>
2776 std::size_t operator()(::rtl::OString
const & s)
const
2778 if constexpr (
sizeof(std::size_t) == 8)
2782 for (sal_Int32 i = 0, len = s.
getLength(); i < len; ++i)
#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
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_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition textenc.h:37
SAL_DLLPUBLIC double rtl_str_toDouble(const char *str) SAL_THROW_EXTERN_C()
Interpret a string as a double.
SAL_DLLPUBLIC sal_Int32 rtl_str_compare(const char *first, const char *second) SAL_THROW_EXTERN_C()
Compare two strings.
SAL_DLLPUBLIC sal_Int32 rtl_str_hashCode_WithLength(const char *str, sal_Int32 len) SAL_THROW_EXTERN_C()
Return a hash code for a string.
SAL_DLLPUBLIC void rtl_string_newReplaceStrAt(rtl_String **newStr, rtl_String *str, sal_Int32 idx, sal_Int32 count, rtl_String *subStr) SAL_THROW_EXTERN_C()
Create a new string by replacing a substring of another string.
SAL_DLLPUBLIC sal_Bool rtl_str_toBoolean(const char *str) SAL_THROW_EXTERN_C()
Interpret a string as a boolean.
#define RTL_STR_MAX_VALUEOFDOUBLE
Definition string.h:715
#define RTL_STR_MAX_VALUEOFINT32
Definition string.h:631
SAL_DLLPUBLIC void rtl_string_acquire(rtl_String *str) SAL_THROW_EXTERN_C()
Increment the reference count of a string.
SAL_DLLPUBLIC rtl_String * rtl_string_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C()
Allocate a new string containing space for a given number of characters.
SAL_DLLPUBLIC void rtl_string_newConcat(rtl_String **newStr, rtl_String *left, rtl_String *right) SAL_THROW_EXTERN_C()
Create a new string that is the concatenation of two other strings.
SAL_DLLPUBLIC sal_uInt32 rtl_str_toUInt32(const char *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an unsigned integer.
SAL_DLLPUBLIC sal_Int32 rtl_str_compareIgnoreAsciiCase(const char *first, const char *second) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
SAL_DLLPUBLIC void rtl_string_assign(rtl_String **str, rtl_String *rightValue) SAL_THROW_EXTERN_C()
Assign a new value to a string.
SAL_DLLPUBLIC sal_Int32 rtl_str_lastIndexOfStr_WithLength(const char *str, sal_Int32 len, const char *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the last occurrence of a substring within a string.
SAL_DLLPUBLIC void rtl_string_newReplaceAll(rtl_String **newStr, rtl_String *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_str_reverseCompare_WithLength(const char *first, sal_Int32 firstLen, const char *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings from back to front.
SAL_DLLPUBLIC sal_uInt64 rtl_str_toUInt64(const char *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an unsigned long integer.
SAL_DLLPUBLIC sal_Int32 rtl_string_getToken(rtl_String **newStr, rtl_String *str, sal_Int32 token, char cTok, sal_Int32 idx) SAL_THROW_EXTERN_C()
Create a new string by extracting a single token from another string.
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfInt64(char *str, sal_Int64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of a long integer.
SAL_DLLPUBLIC void rtl_string_newReplaceFirst(rtl_String **newStr, rtl_String *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 void rtl_string_newFromStr(rtl_String **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_str_shortenedCompare_WithLength(const char *first, sal_Int32 firstLen, const char *second, sal_Int32 secondLen, sal_Int32 shortenedLen) SAL_THROW_EXTERN_C()
Compare two strings with a maximum count of characters.
SAL_DLLPUBLIC void rtl_string_new(rtl_String **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
SAL_DLLPUBLIC sal_Int32 rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(const char *first, sal_Int32 firstLen, const char *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 sal_Int32 rtl_str_indexOfChar_WithLength(const char *str, sal_Int32 len, char ch) SAL_THROW_EXTERN_C()
Search for the first occurrence of a character within a string.
SAL_DLLPUBLIC void rtl_uString2String(rtl_String **newStr, const sal_Unicode *str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags) SAL_THROW_EXTERN_C()
Create a new byte string by converting a Unicode string, using a specific text encoding.
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfBoolean(char *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
#define OUSTRING_TO_OSTRING_CVTFLAGS
Definition string.h:1350
SAL_DLLPUBLIC void rtl_string_newFromLiteral(rtl_String **newStr, const char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
#define RTL_STR_MAX_VALUEOFBOOLEAN
Definition string.h:589
#define RTL_STR_MAX_VALUEOFFLOAT
Definition string.h:696
SAL_DLLPUBLIC sal_Int32 rtl_str_hashCode(const char *str) SAL_THROW_EXTERN_C()
Return a hash code for a string.
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfInt32(char *str, sal_Int32 i, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an integer.
SAL_DLLPUBLIC sal_Int32 rtl_str_getLength(const char *str) SAL_THROW_EXTERN_C()
Return the length of a string.
#define RTL_STR_MAX_VALUEOFUINT64
Definition string.h:677
SAL_DLLPUBLIC void rtl_string_newToAsciiLowerCase(rtl_String **newStr, rtl_String *str) SAL_THROW_EXTERN_C()
Create a new string by converting all ASCII uppercase letters to lowercase within another string.
SAL_DLLPUBLIC void rtl_string_newFromStr_WithLength(rtl_String **newStr, const char *value, sal_Int32 len) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
SAL_DLLPUBLIC void rtl_string_newTrim(rtl_String **newStr, rtl_String *str) SAL_THROW_EXTERN_C()
Create a new string by removing white space from both ends of another string.
SAL_DLLPUBLIC sal_Int32 rtl_str_toInt32(const char *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an integer.
#define RTL_STR_MAX_VALUEOFINT64
Definition string.h:654
SAL_DLLPUBLIC void rtl_string_ensureCapacity(rtl_String **str, sal_Int32 size) SAL_THROW_EXTERN_C()
Ensure a string has enough space for a given number of characters.
SAL_DLLPUBLIC void rtl_string_release(rtl_String *str) SAL_THROW_EXTERN_C()
Decrement the reference count of a string.
SAL_DLLPUBLIC void rtl_string_newFromSubString(rtl_String **newStr, const rtl_String *from, sal_Int32 beginIndex, sal_Int32 count) SAL_THROW_EXTERN_C()
Allocate a new string that is a substring of this string.
SAL_DLLPUBLIC sal_Int32 rtl_str_indexOfStr_WithLength(const char *str, sal_Int32 len, const char *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the first occurrence of a substring within a string.
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfUInt64(char *str, sal_uInt64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an unsigned long integer.
SAL_DLLPUBLIC void rtl_string_newToAsciiUpperCase(rtl_String **newStr, rtl_String *str) SAL_THROW_EXTERN_C()
Create a new string by converting all ASCII lowercase letters to uppercase within another string.
SAL_DLLPUBLIC float rtl_str_toFloat(const char *str) SAL_THROW_EXTERN_C()
Interpret a string as a float.
SAL_DLLPUBLIC void rtl_string_newReplace(rtl_String **newStr, rtl_String *str, char oldChar, char newChar) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a single character within another string.
SAL_DLLPUBLIC sal_Int64 rtl_str_toInt64(const char *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as a long integer.
SAL_DLLPUBLIC sal_Int32 rtl_str_compareIgnoreAsciiCase_WithLength(const char *first, sal_Int32 firstLen, const char *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
SAL_DLLPUBLIC sal_Int32 rtl_str_compare_WithLength(const char *first, sal_Int32 firstLen, const char *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings.
SAL_DLLPUBLIC sal_Int32 rtl_str_lastIndexOfChar_WithLength(const char *str, sal_Int32 len, char ch) SAL_THROW_EXTERN_C()
Search for the last occurrence of a character within a string.
@ rtl_math_StringFormat_G
Like sprintf() G, 'F' or 'E' format is used depending on which one is more compact.
Definition math.h:53
SAL_DLLPUBLIC void rtl_math_doubleToString(rtl_String **pResult, sal_Int32 *pResultCapacity, sal_Int32 nResultOffset, double fValue, enum rtl_math_StringFormat eFormat, sal_Int32 nDecPlaces, char cDecSeparator, sal_Int32 const *pGroups, char cGroupSeparator, sal_Bool bEraseTrailingDecZeros) SAL_THROW_EXTERN_C()
Conversions analogous to sprintf() using internal rounding.
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:2702
This String class provide base functionality for C++ like 8-Bit character array handling.
Definition string.hxx:193
SAL_WARN_UNUSED_RESULT OString concat(const OString &str) const
Concatenates the specified string to the end of this string.
Definition string.hxx:2022
OString(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
New string from a string literal.
Definition string.hxx:345
OString(const sal_Unicode *value, sal_Int32 length, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OUSTRING_TO_OSTRING_CVTFLAGS)
New string from a Unicode character buffer array.
Definition string.hxx:421
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type endsWith(T &literal, OString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition string.hxx:1549
static OString 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 string.hxx:2410
bool startsWith(OString const &str, OString *rest=NULL) const
Check whether this string starts with a given substring.
Definition string.hxx:1140
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(const OString &rStr, T &literal)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition string.hxx:1646
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWith(T &literal, OString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition string.hxx:1204
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(T &literal, const OString &rStr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition string.hxx:1668
static OString valueOf(sal_Bool b)
Returns the string representation of the sal_Bool argument.
Definition string.hxx:2491
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 string.hxx:1831
OString(const char *value, sal_Int32 length)
New string from a character buffer array.
Definition string.hxx:372
static OString 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 string.hxx:2423
static OString number(int i, sal_Int16 radix=10)
Returns the string representation of the integer argument.
Definition string.hxx:2391
sal_uInt64 toUInt64(sal_Int16 radix=10) const
Returns the uint64 value from this string.
Definition string.hxx:2323
sal_Int32 indexOfL(char const *str, sal_Int32 len, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified substring,...
Definition string.hxx:1862
libreoffice_internal::ConstCharArrayDetector< T, OString & >::Type operator=(T &literal)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition string.hxx:537
sal_Int32 compareTo(const OString &str) const
Compares two strings.
Definition string.hxx:719
OString & operator+=(const OString &str)
Append a string to this string.
Definition string.hxx:559
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 string.hxx:881
SAL_WARN_UNUSED_RESULT OString toAsciiUpperCase() const
Converts from this string all ASCII lowercase characters (97-122) to ASCII uppercase characters (65-9...
Definition string.hxx:2166
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWithIgnoreAsciiCase(T &literal, OString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition string.hxx:1382
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(T &literal, const OString &rStr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition string.hxx:1725
char toChar() const
Returns the first character from this string.
Definition string.hxx:2259
bool toBoolean() const
Returns the Boolean value from this string.
Definition string.hxx:2248
friend OString operator+(const OString &str1, const OString &str2)
Definition string.hxx:2031
SAL_WARN_UNUSED_RESULT OString copy(sal_Int32 beginIndex) const
Returns a new string that is a substring of this string.
Definition string.hxx:1949
friend libreoffice_internal::NonConstCharArrayDetector< T, bool >::Type operator!=(const OString &rStr1, T &value)
Definition string.hxx:1691
OString(rtl_String *str)
New string from OString data.
Definition string.hxx:268
bool startsWithIgnoreAsciiCase(OString const &str, OString *rest=NULL) const
Check whether this string starts with a given string, ignoring the case of ASCII letters.
Definition string.hxx:1317
static OString 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 string.hxx:2416
sal_Int32 lastIndexOf(const OString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition string.hxx:1901
void clear()
Clears the string, i.e, makes a zero-character string.
Definition string.hxx:651
SAL_WARN_UNUSED_RESULT OString replaceFirst(OString const &from, OString const &to, sal_Int32 *index=NULL) const
Returns a new string resulting from replacing the first occurrence of a given substring with another ...
Definition string.hxx:2107
OString getToken(sal_Int32 count, char separator) const
Returns a token from the string.
Definition string.hxx:2235
static OString 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 string.hxx:2398
const char * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the characters of this string.
Definition string.hxx:690
OString & operator=(const OString &str)
Assign a new string.
Definition string.hxx:506
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 string.hxx:1053
sal_Int32 compareTo(const OString &rObj, sal_Int32 maxLength) const
Compares two strings with an maximum count of characters.
Definition string.hxx:738
bool isEmpty() const
Checks if a string is empty.
Definition string.hxx:674
friend libreoffice_internal::NonConstCharArrayDetector< T, bool >::Type operator==(T &value, const OString &rStr2)
Definition string.hxx:1632
OString(const T &value, typename libreoffice_internal::CharPtrDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
New string from a character buffer array.
Definition string.hxx:312
OString getToken(sal_Int32 token, char cTok, sal_Int32 &index) const
Returns a token in the string.
Definition string.hxx:2215
sal_Int32 reverseCompareTo(const OString &str) const
Compares two strings in reverse order.
Definition string.hxx:756
sal_Int32 lastIndexOf(const OString &str, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition string.hxx:1932
sal_Int32 lastIndexOf(char ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition string.hxx:1771
SAL_WARN_UNUSED_RESULT OString copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string that is a substring of this string.
Definition string.hxx:1966
friend libreoffice_internal::CharPtrDetector< T, bool >::Type operator!=(const OString &rStr1, const T &value)
Definition string.hxx:1685
SAL_WARN_UNUSED_RESULT OString replace(char oldChar, char newChar) const
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
Definition string.hxx:2082
sal_Int32 hashCode() const
Returns a hashcode for this string.
Definition string.hxx:1737
static OString boolean(bool b)
Returns the string representation of the boolean argument.
Definition string.hxx:2507
bool matchL(char const *str, sal_Int32 strLength, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition string.hxx:994
bool equalsL(const char *value, sal_Int32 length) const
Perform a comparison of two strings.
Definition string.hxx:797
SAL_WARN_UNUSED_RESULT OString trim() const
Returns a new string resulting from removing white space from both ends of the string.
Definition string.hxx:2184
OString(const OString &str)
New string from OString.
Definition string.hxx:216
SAL_WARN_UNUSED_RESULT OString replaceAll(OString const &from, OString const &to) const
Returns a new string resulting from replacing all occurrences of a given substring with another subst...
Definition string.hxx:2131
bool endsWithL(char const *str, sal_Int32 strLength) const
Check whether this string ends with a given substring.
Definition string.hxx:1586
SAL_WARN_UNUSED_RESULT OString toAsciiLowerCase() const
Converts from this string all ASCII uppercase characters (65-90) to ASCII lowercase characters (97-12...
Definition string.hxx:2149
bool match(const OString &str, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition string.hxx:948
float toFloat() const
Returns the float value from this string.
Definition string.hxx:2336
OString()
New string containing no characters.
Definition string.hxx:202
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 string.hxx:962
friend libreoffice_internal::CharPtrDetector< T, bool >::Type operator==(const T &value, const OString &rStr2)
Definition string.hxx:1623
OString(char value)
New string from a single character.
Definition string.hxx:291
static OString number(long i, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition string.hxx:2404
bool equalsIgnoreAsciiCase(const OString &str) const
Perform an ASCII lowercase comparison of two strings.
Definition string.hxx:831
sal_Int64 toInt64(sal_Int16 radix=10) const
Returns the int64 value from this string.
Definition string.hxx:2306
sal_Int32 indexOf(const OString &str, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified substring,...
Definition string.hxx:1817
sal_Int32 toInt32(sal_Int16 radix=10) const
Returns the int32 value from this string.
Definition string.hxx:2274
~OString()
Release the string data.
Definition string.hxx:470
libreoffice_internal::NonConstCharArrayDetector< T, bool >::Type equalsIgnoreAsciiCase(T &asciiStr) const
Definition string.hxx:870
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(const OString &rStr, T &literal)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition string.hxx:1714
libreoffice_internal::CharPtrDetector< T, bool >::Type equalsIgnoreAsciiCase(const T &asciiStr) const
Perform an ASCII lowercase comparison of two strings.
Definition string.hxx:864
sal_Int32 indexOf(char ch, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified character,...
Definition string.hxx:1755
SAL_WARN_UNUSED_RESULT OString replaceAt(sal_Int32 index, sal_Int32 count, const OString &newStr) const
Returns a new string resulting from replacing n = count characters from position index in this string...
Definition string.hxx:2052
sal_Int32 getLength() const
Returns the length of this string.
Definition string.hxx:664
double toDouble() const
Returns the double value from this string.
Definition string.hxx:2349
static OString number(double d)
Returns the string representation of the double argument.
Definition string.hxx:2461
bool endsWith(OString const &str, OString *rest=NULL) const
Check whether this string ends with a given substring.
Definition string.hxx:1469
bool equals(const OString &str) const
Perform a comparison of two strings.
Definition string.hxx:773
friend libreoffice_internal::NonConstCharArrayDetector< T, bool >::Type operator==(const OString &rStr1, T &value)
Definition string.hxx:1614
OString(rtl_String *str, __sal_NoAcquire)
New string from OString data without acquiring it.
Definition string.hxx:281
sal_Int32 lastIndexOf(char ch, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified character,...
Definition string.hxx:1788
OString(T &value, typename libreoffice_internal::NonConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Definition string.hxx:319
friend libreoffice_internal::CharPtrDetector< T, bool >::Type operator==(const OString &rStr1, const T &value)
Definition string.hxx:1605
sal_uInt32 toUInt32(sal_Int16 radix=10) const
Returns the uint32 value from this string.
Definition string.hxx:2291
static OString number(float f)
Returns the string representation of the float argument.
Definition string.hxx:2439
friend libreoffice_internal::CharPtrDetector< T, bool >::Type operator!=(const T &value, const OString &rStr2)
Definition string.hxx:1697
bool equalsIgnoreAsciiCaseL(const char *asciiStr, sal_Int32 asciiStrLength) const
Perform an ASCII lowercase comparison of two strings.
Definition string.hxx:916
bool matchIgnoreAsciiCase(const OString &str, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string, ignoring the case of ASCII letters.
Definition string.hxx:1039
friend libreoffice_internal::NonConstCharArrayDetector< T, bool >::Type operator!=(T &value, const OString &rStr2)
Definition string.hxx:1703
A helper to use OStrings with hash maps.
Definition string.hxx:2665
size_t operator()(const OString &rString) const
Compute a hash code for a string.
Definition string.hxx:2675
Equality functor for classic c-strings (i.e., null-terminated char* strings).
Definition string.hxx:2681
bool operator()(const char *p1, const char *p2) const
Definition string.hxx:2682
Hashing functor for classic c-strings (i.e., null-terminated char* strings).
Definition string.hxx:2688
size_t operator()(const char *p) const
Definition string.hxx:2689
Definition stringutils.hxx:178
Definition stringutils.hxx:181
Definition stringutils.hxx:205
Definition stringutils.hxx:233