LibreOffice
LibreOffice 7.0 SDK C/C++ API Reference
ustring.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_RTL_USTRING_HXX
21 #define INCLUDED_RTL_USTRING_HXX
22 
23 #include "sal/config.h"
24 
25 #include <cassert>
26 #include <cstddef>
27 #include <limits>
28 #include <new>
29 #include <ostream>
30 #include <utility>
31 
32 #if defined LIBO_INTERNAL_ONLY
33 #include <string_view>
34 #endif
35 
36 #include "rtl/ustring.h"
37 #include "rtl/string.hxx"
38 #include "rtl/stringutils.hxx"
39 #include "rtl/textenc.h"
40 
41 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
42 #include "rtl/stringconcat.hxx"
43 #endif
44 
45 #ifdef RTL_STRING_UNITTEST
46 extern bool rtl_string_unittest_invalid_conversion;
47 #endif
48 
49 // The unittest uses slightly different code to help check that the proper
50 // calls are made. The class is put into a different namespace to make
51 // sure the compiler generates a different (if generating also non-inline)
52 // copy of the function and does not merge them together. The class
53 // is "brought" into the proper rtl namespace by a typedef below.
54 #ifdef RTL_STRING_UNITTEST
55 #define rtl rtlunittest
56 #endif
57 
58 namespace rtl
59 {
60 
61 class OUStringBuffer;
62 
63 #ifdef RTL_STRING_UNITTEST
64 #undef rtl
65 #endif
66 
67 #if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
68 
76 struct SAL_WARN_UNUSED OUStringLiteral
77 {
78  template<typename T> constexpr OUStringLiteral(
79  T & literal,
80  typename libreoffice_internal::ConstCharArrayDetector<
81  T, libreoffice_internal::Dummy>::Type
82  = libreoffice_internal::Dummy()):
83  size(libreoffice_internal::ConstCharArrayDetector<T>::length),
84  data(
85  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal))
86  {
87  assert(
88  libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal));
89  }
90 
91  int size;
92  const char* data;
93 
94  // So we can use this struct in some places interchangeably with OUString
95  constexpr sal_Int32 getLength() const { return size; }
96 };
97 
99 #endif
100 
101 /* ======================================================================= */
102 
126 class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI OUString
127 {
128 public:
130  rtl_uString * pData;
132 
137  {
138  pData = NULL;
139  rtl_uString_new( &pData );
140  }
141 
147  OUString( const OUString & str )
148  {
149  pData = str.pData;
150  rtl_uString_acquire( pData );
151  }
152 
153 #if defined LIBO_INTERNAL_ONLY
154 
160  OUString( OUString && str ) noexcept
161  {
162  pData = str.pData;
163  str.pData = nullptr;
164  rtl_uString_new( &str.pData );
165  }
166 #endif
167 
173  OUString( rtl_uString * str )
174  {
175  pData = str;
176  rtl_uString_acquire( pData );
177  }
178 
187  OUString( rtl_uString * str, __sal_NoAcquire )
188  { pData = str; }
189 
195  explicit OUString( sal_Unicode value )
196  : pData (NULL)
197  {
198  rtl_uString_newFromStr_WithLength( &pData, &value, 1 );
199  }
200 
201 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST_CONCAT
202  // Catch inadvertent conversions to the above ctor (but still allow
204  // construction from char literals):
205  OUString(int) = delete;
206  explicit OUString(char c):
207  OUString(sal_Unicode(static_cast<unsigned char>(c)))
208  {}
210 #endif
211 
217  OUString( const sal_Unicode * value )
218  {
219  pData = NULL;
220  rtl_uString_newFromStr( &pData, value );
221  }
222 
231  OUString( const sal_Unicode * value, sal_Int32 length )
232  {
233  pData = NULL;
234  rtl_uString_newFromStr_WithLength( &pData, value, length );
235  }
236 
252  template< typename T >
254  {
255  assert(
257  pData = NULL;
259  rtl_uString_new(&pData);
260  } else {
262  &pData,
264  literal),
266  }
267 #ifdef RTL_STRING_UNITTEST
268  rtl_string_unittest_const_literal = true;
269 #endif
270  }
271 
272 #if defined LIBO_INTERNAL_ONLY
273 
274  template<typename T> OUString(
275  T & literal,
277  T, libreoffice_internal::Dummy>::TypeUtf16
279  pData(nullptr)
280  {
282  rtl_uString_new(&pData);
283  } else {
285  &pData,
286  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
287  literal),
288  libreoffice_internal::ConstCharArrayDetector<T>::length);
289  }
290  }
291 #endif
292 
293 #ifdef RTL_STRING_UNITTEST
294 
298  template< typename T >
299  OUString( T&, typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
300  {
301  pData = NULL;
302  rtl_uString_newFromLiteral( &pData, "!!br0ken!!", 10, 0 ); // set to garbage
303  rtl_string_unittest_invalid_conversion = true;
304  }
309  template< typename T >
310  OUString( const T&, typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
311  {
312  pData = NULL;
313  rtl_uString_newFromLiteral( &pData, "!!br0ken!!", 10, 0 ); // set to garbage
314  rtl_string_unittest_invalid_conversion = true;
315  }
316 #endif
317 
318 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
319 
335  OUString(OUStringLiteral literal): pData(NULL) {
336  rtl_uString_newFromLiteral(&pData, literal.data, literal.size, 0);
337  }
339 #endif
340 
355  OUString( const sal_Char * value, sal_Int32 length,
356  rtl_TextEncoding encoding,
357  sal_uInt32 convertFlags = OSTRING_TO_OUSTRING_CVTFLAGS )
358  {
359  pData = NULL;
360  rtl_string2UString( &pData, value, length, encoding, convertFlags );
361  if (pData == NULL) {
362  throw std::bad_alloc();
363  }
364  }
365 
382  explicit OUString(
383  sal_uInt32 const * codePoints, sal_Int32 codePointCount):
384  pData(NULL)
385  {
386  rtl_uString_newFromCodePoints(&pData, codePoints, codePointCount);
387  if (pData == NULL) {
388  throw std::bad_alloc();
389  }
390  }
391 
392 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
393 
397  template< typename T1, typename T2 >
398  OUString( OUStringConcat< T1, T2 >&& c )
399  {
400  const sal_Int32 l = c.length();
401  pData = rtl_uString_alloc( l );
402  if (l != 0)
403  {
404  sal_Unicode* end = c.addData( pData->buffer );
405  pData->length = l;
406  *end = '\0';
407  // TODO realloc in case pData->length is noticeably smaller than l?
408  }
409  }
410 
415  template< typename T >
416  OUString( OUStringNumber< T >&& n )
417  : OUString( n.buf, n.length )
418  {}
419 #endif
420 
421 #if defined LIBO_INTERNAL_ONLY
422  OUString(std::u16string_view sv) {
423  if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
424  throw std::bad_alloc();
425  }
426  pData = nullptr;
427  rtl_uString_newFromStr_WithLength(&pData, sv.data(), sv.size());
428  }
429 #endif
430 
435  {
436  rtl_uString_release( pData );
437  }
438 
450  static OUString const & unacquired( rtl_uString * const * ppHandle )
451  { return * reinterpret_cast< OUString const * >( ppHandle ); }
452 
458  OUString & operator=( const OUString & str )
459  {
460  rtl_uString_assign( &pData, str.pData );
461  return *this;
462  }
463 
464 #if defined LIBO_INTERNAL_ONLY
465 
471  OUString & operator=( OUString && str ) noexcept
472  {
473  rtl_uString_release( pData );
474  pData = str.pData;
475  str.pData = nullptr;
476  rtl_uString_new( &str.pData );
477  return *this;
478  }
479 #endif
480 
493  template< typename T >
495  {
496  assert(
499  rtl_uString_new(&pData);
500  } else {
502  &pData,
504  literal),
506  }
507  return *this;
508  }
509 
510 #if defined LIBO_INTERNAL_ONLY
511 
512  template<typename T>
513  typename
515  operator =(T & literal) {
517  rtl_uString_new(&pData);
518  } else {
520  &pData,
521  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
522  literal),
523  libreoffice_internal::ConstCharArrayDetector<T>::length);
524  }
525  return *this;
526  }
527 
529  OUString & operator =(OUStringLiteral const & literal) {
530  if (literal.size == 0) {
531  rtl_uString_new(&pData);
532  } else {
533  rtl_uString_newFromLiteral(&pData, literal.data, literal.size, 0);
534  }
535  return *this;
536  }
537 #endif
538 
539 #if defined LIBO_INTERNAL_ONLY
540 
548  inline OUString & operator+=( const OUStringBuffer & str ) &;
549 #endif
550 
558  OUString & operator+=( const OUString & str )
559 #if defined LIBO_INTERNAL_ONLY
560  &
561 #endif
562  {
563  return internalAppend(str.pData);
564  }
565 #if defined LIBO_INTERNAL_ONLY
566  void operator+=(OUString const &) && = delete;
567 #endif
568 
575  template<typename T>
577  operator +=(T & literal)
578 #if defined LIBO_INTERNAL_ONLY
579  &
580 #endif
581  {
582  assert(
585  &pData, pData,
588  return *this;
589  }
590 #if defined LIBO_INTERNAL_ONLY
591  template<typename T>
593  operator +=(T &) && = delete;
594 #endif
595 
596 #if defined LIBO_INTERNAL_ONLY
597 
598  template<typename T>
599  typename
601  operator +=(T & literal) & {
603  &pData, pData,
606  return *this;
607  }
608  template<typename T>
609  typename
610  libreoffice_internal::ConstCharArrayDetector<T, OUString &>::TypeUtf16
611  operator +=(T &) && = delete;
612 
614  OUString & operator +=(OUStringLiteral const & literal) & {
615  rtl_uString_newConcatAsciiL(&pData, pData, literal.data, literal.size);
616  return *this;
617  }
618  void operator +=(OUStringLiteral const &) && = delete;
619 #endif
620 
621 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
622 
626  template< typename T1, typename T2 >
627  OUString& operator+=( OUStringConcat< T1, T2 >&& c ) & {
628  sal_Int32 l = c.length();
629  if( l == 0 )
630  return *this;
631  l += pData->length;
632  rtl_uString_ensureCapacity( &pData, l );
633  sal_Unicode* end = c.addData( pData->buffer + pData->length );
634  *end = '\0';
635  pData->length = l;
636  return *this;
637  }
638  template<typename T1, typename T2> void operator +=(
639  OUStringConcat<T1, T2> &&) && = delete;
640 
645  template< typename T >
646  OUString& operator+=( OUStringNumber< T >&& n ) & {
647  sal_Int32 l = n.length;
648  if( l == 0 )
649  return *this;
650  l += pData->length;
651  rtl_uString_ensureCapacity( &pData, l );
652  sal_Unicode* end = addDataHelper( pData->buffer + pData->length, n.buf, n.length );
653  *end = '\0';
654  pData->length = l;
655  return *this;
656  }
657  template<typename T> void operator +=(
658  OUStringNumber<T> &&) && = delete;
659 #endif
660 
665  void clear()
666  {
667  rtl_uString_new( &pData );
668  }
669 
678  sal_Int32 getLength() const { return pData->length; }
679 
688  bool isEmpty() const
689  {
690  return pData->length == 0;
691  }
692 
700  const sal_Unicode * getStr() const SAL_RETURNS_NONNULL { return pData->buffer; }
701 
711  sal_Unicode operator [](sal_Int32 index) const {
712  // silence spurious -Werror=strict-overflow warnings from GCC 4.8.2
713  assert(index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength()));
714  return getStr()[index];
715  }
716 
729  sal_Int32 compareTo( const OUString & str ) const
730  {
731  return rtl_ustr_compare_WithLength( pData->buffer, pData->length,
732  str.pData->buffer, str.pData->length );
733  }
734 
750  sal_Int32 compareTo( const OUString & str, sal_Int32 maxLength ) const
751  {
752  return rtl_ustr_shortenedCompare_WithLength( pData->buffer, pData->length,
753  str.pData->buffer, str.pData->length, maxLength );
754  }
755 
768  sal_Int32 reverseCompareTo( const OUString & str ) const
769  {
770  return rtl_ustr_reverseCompare_WithLength( pData->buffer, pData->length,
771  str.pData->buffer, str.pData->length );
772  }
773 
779  template< typename T >
781  {
782  assert(
785  pData->buffer, pData->length,
788  }
789 
790 #if defined LIBO_INTERNAL_ONLY
791 
792  template<typename T>
793  typename
795  reverseCompareTo(T & literal) const {
797  pData->buffer, pData->length,
800  }
801 
803  sal_Int32 reverseCompareTo(OUStringLiteral const & literal) const {
805  pData->buffer, pData->length, literal.data, literal.size);
806  }
807 #endif
808 
820  bool equals( const OUString & str ) const
821  {
822  if ( pData->length != str.pData->length )
823  return false;
824  if ( pData == str.pData )
825  return true;
826  return rtl_ustr_reverseCompare_WithLength( pData->buffer, pData->length,
827  str.pData->buffer, str.pData->length ) == 0;
828  }
829 
844  bool equalsIgnoreAsciiCase( const OUString & str ) const
845  {
846  if ( pData->length != str.pData->length )
847  return false;
848  if ( pData == str.pData )
849  return true;
850  return rtl_ustr_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length,
851  str.pData->buffer, str.pData->length ) == 0;
852  }
853 
869  sal_Int32 compareToIgnoreAsciiCase( const OUString & str ) const
870  {
871  return rtl_ustr_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length,
872  str.pData->buffer, str.pData->length );
873  }
874 
875 
881  template< typename T >
883  {
884  assert(
886  return
887  (pData->length
890  pData->buffer, pData->length,
892  literal))
893  == 0);
894  }
895 
896 #if defined LIBO_INTERNAL_ONLY
897 
898  template<typename T>
900  equalsIgnoreAsciiCase(T & literal) const {
901  return
903  pData->buffer, pData->length,
905  literal),
907  == 0;
908  }
909 
911  bool equalsIgnoreAsciiCase(OUStringLiteral const & literal) const {
912  return pData->length == literal.size
914  pData->buffer, pData->length, literal.data)
915  == 0);
916  }
917 #endif
918 
934  bool match( const OUString & str, sal_Int32 fromIndex = 0 ) const
935  {
936  return rtl_ustr_shortenedCompare_WithLength( pData->buffer+fromIndex, pData->length-fromIndex,
937  str.pData->buffer, str.pData->length, str.pData->length ) == 0;
938  }
939 
945  template< typename T >
946  typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type match( T& literal, sal_Int32 fromIndex = 0 ) const
947  {
948  assert(
950  return
952  pData->buffer+fromIndex, pData->length-fromIndex,
954  literal),
956  == 0;
957  }
958 
959 #if defined LIBO_INTERNAL_ONLY
960 
961  template<typename T>
963  match(T & literal, sal_Int32 fromIndex = 0) const {
964  assert(fromIndex >= 0);
965  return
967  pData->buffer + fromIndex, pData->length - fromIndex,
969  literal),
972  == 0;
973  }
974 
976  bool match(OUStringLiteral const & literal, sal_Int32 fromIndex = 0) const {
977  return
979  pData->buffer + fromIndex, pData->length - fromIndex,
980  literal.data, literal.size)
981  == 0;
982  }
983 #endif
984 
1003  bool matchIgnoreAsciiCase( const OUString & str, sal_Int32 fromIndex = 0 ) const
1004  {
1005  return rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( pData->buffer+fromIndex, pData->length-fromIndex,
1006  str.pData->buffer, str.pData->length,
1007  str.pData->length ) == 0;
1008  }
1009 
1015  template< typename T >
1016  typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type matchIgnoreAsciiCase( T& literal, sal_Int32 fromIndex = 0 ) const
1017  {
1018  assert(
1020  return
1022  pData->buffer+fromIndex, pData->length-fromIndex,
1024  literal),
1026  == 0;
1027  }
1028 
1029 #if defined LIBO_INTERNAL_ONLY
1030 
1031  template<typename T>
1033  matchIgnoreAsciiCase(T & literal, sal_Int32 fromIndex = 0) const {
1034  assert(fromIndex >= 0);
1035  return
1037  pData->buffer + fromIndex, pData->length - fromIndex,
1039  literal),
1042  == 0;
1043  }
1044 
1046  bool matchIgnoreAsciiCase(
1047  OUStringLiteral const & literal, sal_Int32 fromIndex = 0) const
1048  {
1049  return
1051  pData->buffer+fromIndex, pData->length-fromIndex, literal.data,
1052  literal.size)
1053  == 0;
1054  }
1055 #endif
1056 
1073  sal_Int32 compareToAscii( const sal_Char* asciiStr ) const
1074  {
1075  return rtl_ustr_ascii_compare_WithLength( pData->buffer, pData->length, asciiStr );
1076  }
1077 
1101  "replace s1.compareToAscii(s2, strlen(s2)) == 0 with s1.startsWith(s2)")
1102  sal_Int32 compareToAscii( const sal_Char * asciiStr, sal_Int32 maxLength ) const
1103  {
1104  return rtl_ustr_ascii_shortenedCompare_WithLength( pData->buffer, pData->length,
1105  asciiStr, maxLength );
1106  }
1107 
1127  sal_Int32 reverseCompareToAsciiL( const sal_Char * asciiStr, sal_Int32 asciiStrLength ) const
1128  {
1129  return rtl_ustr_asciil_reverseCompare_WithLength( pData->buffer, pData->length,
1130  asciiStr, asciiStrLength );
1131  }
1132 
1148  bool equalsAscii( const sal_Char* asciiStr ) const
1149  {
1150  return rtl_ustr_ascii_compare_WithLength( pData->buffer, pData->length,
1151  asciiStr ) == 0;
1152  }
1153 
1171  bool equalsAsciiL( const sal_Char* asciiStr, sal_Int32 asciiStrLength ) const
1172  {
1173  if ( pData->length != asciiStrLength )
1174  return false;
1175 
1177  pData->buffer, asciiStr, asciiStrLength );
1178  }
1179 
1198  bool equalsIgnoreAsciiCaseAscii( const sal_Char * asciiStr ) const
1199  {
1200  return rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length, asciiStr ) == 0;
1201  }
1202 
1221  sal_Int32 compareToIgnoreAsciiCaseAscii( const sal_Char * asciiStr ) const
1222  {
1223  return rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length, asciiStr );
1224  }
1225 
1246  bool equalsIgnoreAsciiCaseAsciiL( const sal_Char * asciiStr, sal_Int32 asciiStrLength ) const
1247  {
1248  if ( pData->length != asciiStrLength )
1249  return false;
1250 
1251  return rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length, asciiStr ) == 0;
1252  }
1253 
1275  bool matchAsciiL( const sal_Char* asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex = 0 ) const
1276  {
1277  return rtl_ustr_ascii_shortenedCompare_WithLength( pData->buffer+fromIndex, pData->length-fromIndex,
1278  asciiStr, asciiStrLength ) == 0;
1279  }
1280 
1281  // This overload is left undefined, to detect calls of matchAsciiL that
1282  // erroneously use RTL_CONSTASCII_USTRINGPARAM instead of
1283  // RTL_CONSTASCII_STRINGPARAM (but would lead to ambiguities on 32 bit
1284  // platforms):
1285 #if SAL_TYPES_SIZEOFLONG == 8
1286  void matchAsciiL(char const *, sal_Int32, rtl_TextEncoding) const;
1287 #endif
1288 
1313  bool matchIgnoreAsciiCaseAsciiL( const sal_Char* asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex = 0 ) const
1314  {
1315  return rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( pData->buffer+fromIndex, pData->length-fromIndex,
1316  asciiStr, asciiStrLength ) == 0;
1317  }
1318 
1319  // This overload is left undefined, to detect calls of
1320  // matchIgnoreAsciiCaseAsciiL that erroneously use
1321  // RTL_CONSTASCII_USTRINGPARAM instead of RTL_CONSTASCII_STRINGPARAM (but
1322  // would lead to ambiguities on 32 bit platforms):
1323 #if SAL_TYPES_SIZEOFLONG == 8
1324  void matchIgnoreAsciiCaseAsciiL(char const *, sal_Int32, rtl_TextEncoding)
1325  const;
1326 #endif
1327 
1342  bool startsWith(OUString const & str, OUString * rest = NULL) const {
1343  bool b = match(str);
1344  if (b && rest != NULL) {
1345  *rest = copy(str.getLength());
1346  }
1347  return b;
1348  }
1349 
1355  template< typename T >
1357  T & literal, OUString * rest = NULL) const
1358  {
1359  assert(
1361  bool b
1363  <= sal_uInt32(pData->length))
1365  pData->buffer,
1367  literal),
1369  if (b && rest != NULL) {
1370  *rest = copy(
1372  }
1373  return b;
1374  }
1375 
1376 #if defined LIBO_INTERNAL_ONLY
1377 
1378  template<typename T>
1380  startsWith(T & literal, OUString * rest = nullptr) const {
1381  bool b
1383  <= sal_uInt32(pData->length))
1385  pData->buffer,
1388  literal),
1390  == 0);
1391  if (b && rest != nullptr) {
1392  *rest = copy(
1394  }
1395  return b;
1396  }
1397 
1399  bool startsWith(OUStringLiteral const & literal, OUString * rest = nullptr)
1400  const
1401  {
1402  bool b = literal.size <= pData->length
1404  pData->buffer, literal.data, literal.size);
1405  if (b && rest != nullptr) {
1406  *rest = copy(literal.size);
1407  }
1408  return b;
1409  }
1410 #endif
1411 
1432  bool startsWithIgnoreAsciiCase(OUString const & str, OUString * rest = NULL)
1433  const
1434  {
1435  bool b = matchIgnoreAsciiCase(str);
1436  if (b && rest != NULL) {
1437  *rest = copy(str.getLength());
1438  }
1439  return b;
1440  }
1441 
1447  template< typename T >
1449  startsWithIgnoreAsciiCase(T & literal, OUString * rest = NULL) const
1450  {
1451  assert(
1453  bool b
1455  pData->buffer,
1458  literal),
1460  == 0);
1461  if (b && rest != NULL) {
1462  *rest = copy(
1464  }
1465  return b;
1466  }
1467 
1468 #if defined LIBO_INTERNAL_ONLY
1469 
1470  template<typename T>
1472  startsWithIgnoreAsciiCase(T & literal, OUString * rest = nullptr) const {
1473  bool b
1475  <= sal_uInt32(pData->length))
1477  pData->buffer,
1480  literal),
1482  == 0);
1483  if (b && rest != nullptr) {
1484  *rest = copy(
1486  }
1487  return b;
1488  }
1489 
1491  bool startsWithIgnoreAsciiCase(
1492  OUStringLiteral const & literal, OUString * rest = nullptr) const
1493  {
1494  bool b
1496  pData->buffer, literal.size, literal.data, literal.size)
1497  == 0);
1498  if (b && rest != nullptr) {
1499  *rest = copy(literal.size);
1500  }
1501  return b;
1502  }
1503 #endif
1504 
1519  bool endsWith(OUString const & str, OUString * rest = NULL) const {
1520  bool b = str.getLength() <= getLength()
1521  && match(str, getLength() - str.getLength());
1522  if (b && rest != NULL) {
1523  *rest = copy(0, getLength() - str.getLength());
1524  }
1525  return b;
1526  }
1527 
1533  template< typename T >
1535  endsWith(T & literal, OUString * rest = NULL) const
1536  {
1537  assert(
1539  bool b
1541  <= sal_uInt32(pData->length))
1543  (pData->buffer + pData->length
1546  literal),
1548  if (b && rest != NULL) {
1549  *rest = copy(
1550  0,
1551  (getLength()
1553  }
1554  return b;
1555  }
1556 
1557 #if defined LIBO_INTERNAL_ONLY
1558 
1559  template<typename T>
1561  endsWith(T & literal, OUString * rest = nullptr) const {
1562  bool b
1564  <= sal_uInt32(pData->length))
1566  (pData->buffer + pData->length
1570  literal),
1572  == 0);
1573  if (b && rest != nullptr) {
1574  *rest = copy(
1575  0,
1576  (getLength()
1578  }
1579  return b;
1580  }
1581 
1583  bool endsWith(OUStringLiteral const & literal, OUString * rest = nullptr)
1584  const
1585  {
1586  bool b = literal.size <= pData->length
1588  pData->buffer + pData->length - literal.size,
1589  literal.data, literal.size);
1590  if (b && rest != nullptr) {
1591  *rest = copy(0, (getLength() - literal.size));
1592  }
1593  return b;
1594  }
1595 #endif
1596 
1608  bool endsWithAsciiL(char const * asciiStr, sal_Int32 asciiStrLength)
1609  const
1610  {
1611  return asciiStrLength <= pData->length
1613  pData->buffer + pData->length - asciiStrLength, asciiStr,
1614  asciiStrLength);
1615  }
1616 
1637  bool endsWithIgnoreAsciiCase(OUString const & str, OUString * rest = NULL) const
1638  {
1639  bool b = str.getLength() <= getLength()
1640  && matchIgnoreAsciiCase(str, getLength() - str.getLength());
1641  if (b && rest != NULL) {
1642  *rest = copy(0, getLength() - str.getLength());
1643  }
1644  return b;
1645  }
1646 
1652  template< typename T >
1654  endsWithIgnoreAsciiCase(T & literal, OUString * rest = NULL) const
1655  {
1656  assert(
1658  bool b
1660  <= sal_uInt32(pData->length))
1662  (pData->buffer + pData->length
1666  literal),
1668  == 0);
1669  if (b && rest != NULL) {
1670  *rest = copy(
1671  0,
1672  (getLength()
1674  }
1675  return b;
1676  }
1677 
1678 #if defined LIBO_INTERNAL_ONLY
1679 
1680  template<typename T>
1682  endsWithIgnoreAsciiCase(T & literal, OUString * rest = nullptr) const {
1683  bool b
1685  <= sal_uInt32(pData->length))
1687  (pData->buffer + pData->length
1691  literal),
1693  == 0);
1694  if (b && rest != nullptr) {
1695  *rest = copy(
1696  0,
1697  (getLength()
1699  }
1700  return b;
1701  }
1702 
1704  bool endsWithIgnoreAsciiCase(
1705  OUStringLiteral const & literal, OUString * rest = nullptr) const
1706  {
1707  bool b = literal.size <= pData->length
1709  pData->buffer + pData->length - literal.size,
1710  literal.size, literal.data, literal.size)
1711  == 0);
1712  if (b && rest != nullptr) {
1713  *rest = copy(0, getLength() - literal.size);
1714  }
1715  return b;
1716  }
1717 #endif
1718 
1730  char const * asciiStr, sal_Int32 asciiStrLength) const
1731  {
1732  return asciiStrLength <= pData->length
1734  pData->buffer + pData->length - asciiStrLength,
1735  asciiStrLength, asciiStr, asciiStrLength)
1736  == 0);
1737  }
1738 
1739  friend bool operator == ( const OUString& rStr1, const OUString& rStr2 )
1740  { return rStr1.equals(rStr2); }
1741  friend bool operator == ( const OUString& rStr1, const sal_Unicode * pStr2 )
1742  { return rStr1.compareTo( pStr2 ) == 0; }
1743  friend bool operator == ( const sal_Unicode * pStr1, const OUString& rStr2 )
1744  { return OUString( pStr1 ).compareTo( rStr2 ) == 0; }
1745 
1746  friend bool operator != ( const OUString& rStr1, const OUString& rStr2 )
1747  { return !(operator == ( rStr1, rStr2 )); }
1748  friend bool operator != ( const OUString& rStr1, const sal_Unicode * pStr2 )
1749  { return !(operator == ( rStr1, pStr2 )); }
1750  friend bool operator != ( const sal_Unicode * pStr1, const OUString& rStr2 )
1751  { return !(operator == ( pStr1, rStr2 )); }
1752 
1753  friend bool operator < ( const OUString& rStr1, const OUString& rStr2 )
1754  { return rStr1.compareTo( rStr2 ) < 0; }
1755  friend bool operator > ( const OUString& rStr1, const OUString& rStr2 )
1756  { return rStr1.compareTo( rStr2 ) > 0; }
1757  friend bool operator <= ( const OUString& rStr1, const OUString& rStr2 )
1758  { return rStr1.compareTo( rStr2 ) <= 0; }
1759  friend bool operator >= ( const OUString& rStr1, const OUString& rStr2 )
1760  { return rStr1.compareTo( rStr2 ) >= 0; }
1761 
1769  template< typename T >
1771  {
1772  assert(
1774  return rString.equalsAsciiL(
1777  }
1785  template< typename T >
1787  {
1788  assert(
1790  return rString.equalsAsciiL(
1793  }
1801  template< typename T >
1803  {
1804  assert(
1806  return !rString.equalsAsciiL(
1809  }
1817  template< typename T >
1819  {
1820  assert(
1822  return !rString.equalsAsciiL(
1825  }
1826 
1827 #if defined LIBO_INTERNAL_ONLY
1828 
1829  template<typename T> friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
1830  operator ==(OUString & string, T & literal) {
1831  return
1833  string.pData->buffer, string.pData->length,
1835  literal),
1837  == 0;
1838  }
1840  template<typename T> friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
1841  operator ==(T & literal, OUString & string) {
1842  return
1844  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
1845  literal),
1846  libreoffice_internal::ConstCharArrayDetector<T>::length,
1847  string.pData->buffer, string.pData->length)
1848  == 0;
1849  }
1851  template<typename T> friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
1852  operator !=(OUString & string, T & literal) {
1853  return
1855  string.pData->buffer, string.pData->length,
1856  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
1857  literal),
1858  libreoffice_internal::ConstCharArrayDetector<T>::length)
1859  != 0;
1860  }
1862  template<typename T> friend typename libreoffice_internal::ConstCharArrayDetector<T, bool>::TypeUtf16
1863  operator !=(T & literal, OUString & string) {
1864  return
1866  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(
1867  literal),
1868  libreoffice_internal::ConstCharArrayDetector<T>::length,
1869  string.pData->buffer, string.pData->length)
1870  != 0;
1871  }
1872 #endif
1873 
1874 #if defined LIBO_INTERNAL_ONLY
1875 
1877  /* Comparison between OUString and OUStringLiteral.
1878 
1879  @since LibreOffice 5.0
1880  */
1881 
1882  friend bool operator ==(OUString const & lhs, OUStringLiteral const & rhs) {
1883  return lhs.equalsAsciiL(rhs.data, rhs.size);
1884  }
1885 
1886  friend bool operator !=(OUString const & lhs, OUStringLiteral const & rhs) {
1887  return !lhs.equalsAsciiL(rhs.data, rhs.size);
1888  }
1889 
1890  friend bool operator <(OUString const & lhs, OUStringLiteral const & rhs) {
1891  return
1893  lhs.pData->buffer, lhs.pData->length, rhs.data))
1894  < 0;
1895  }
1896 
1897  friend bool operator <=(OUString const & lhs, OUStringLiteral const & rhs) {
1898  return
1900  lhs.pData->buffer, lhs.pData->length, rhs.data))
1901  <= 0;
1902  }
1903 
1904  friend bool operator >(OUString const & lhs, OUStringLiteral const & rhs) {
1905  return
1907  lhs.pData->buffer, lhs.pData->length, rhs.data))
1908  > 0;
1909  }
1910 
1911  friend bool operator >=(OUString const & lhs, OUStringLiteral const & rhs) {
1912  return
1914  lhs.pData->buffer, lhs.pData->length, rhs.data))
1915  >= 0;
1916  }
1917 
1918  friend bool operator ==(OUStringLiteral const & lhs, OUString const & rhs) {
1919  return rhs.equalsAsciiL(lhs.data, lhs.size);
1920  }
1921 
1922  friend bool operator !=(OUStringLiteral const & lhs, OUString const & rhs) {
1923  return !rhs.equalsAsciiL(lhs.data, lhs.size);
1924  }
1925 
1926  friend bool operator <(OUStringLiteral const & lhs, OUString const & rhs) {
1927  return
1929  rhs.pData->buffer, rhs.pData->length, lhs.data))
1930  >= 0;
1931  }
1932 
1933  friend bool operator <=(OUStringLiteral const & lhs, OUString const & rhs) {
1934  return
1936  rhs.pData->buffer, rhs.pData->length, lhs.data))
1937  > 0;
1938  }
1939 
1940  friend bool operator >(OUStringLiteral const & lhs, OUString const & rhs) {
1941  return
1943  rhs.pData->buffer, rhs.pData->length, lhs.data))
1944  <= 0;
1945  }
1946 
1947  friend bool operator >=(OUStringLiteral const & lhs, OUString const & rhs) {
1948  return
1950  rhs.pData->buffer, rhs.pData->length, lhs.data))
1951  < 0;
1952  }
1953 
1955 #endif
1956 
1964  sal_Int32 hashCode() const
1965  {
1966  return rtl_ustr_hashCode_WithLength( pData->buffer, pData->length );
1967  }
1968 
1982  sal_Int32 indexOf( sal_Unicode ch, sal_Int32 fromIndex = 0 ) const
1983  {
1984  sal_Int32 ret = rtl_ustr_indexOfChar_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, ch );
1985  return (ret < 0 ? ret : ret+fromIndex);
1986  }
1987 
1997  sal_Int32 lastIndexOf( sal_Unicode ch ) const
1998  {
1999  return rtl_ustr_lastIndexOfChar_WithLength( pData->buffer, pData->length, ch );
2000  }
2001 
2014  sal_Int32 lastIndexOf( sal_Unicode ch, sal_Int32 fromIndex ) const
2015  {
2016  return rtl_ustr_lastIndexOfChar_WithLength( pData->buffer, fromIndex, ch );
2017  }
2018 
2034  sal_Int32 indexOf( const OUString & str, sal_Int32 fromIndex = 0 ) const
2035  {
2036  sal_Int32 ret = rtl_ustr_indexOfStr_WithLength( pData->buffer+fromIndex, pData->length-fromIndex,
2037  str.pData->buffer, str.pData->length );
2038  return (ret < 0 ? ret : ret+fromIndex);
2039  }
2040 
2046  template< typename T >
2047  typename libreoffice_internal::ConstCharArrayDetector< T, sal_Int32 >::Type indexOf( T& literal, sal_Int32 fromIndex = 0 ) const
2048  {
2049  assert(
2051  sal_Int32 n = rtl_ustr_indexOfAscii_WithLength(
2052  pData->buffer + fromIndex, pData->length - fromIndex,
2055  return n < 0 ? n : n + fromIndex;
2056  }
2057 
2058 #if defined LIBO_INTERNAL_ONLY
2059 
2060  template<typename T>
2061  typename
2063  indexOf(T & literal, sal_Int32 fromIndex = 0) const {
2064  assert(fromIndex >= 0);
2066  pData->buffer + fromIndex, pData->length - fromIndex,
2069  return n < 0 ? n : n + fromIndex;
2070  }
2071 
2073  sal_Int32 indexOf(OUStringLiteral const & literal, sal_Int32 fromIndex = 0)
2074  const
2075  {
2076  sal_Int32 n = rtl_ustr_indexOfAscii_WithLength(
2077  pData->buffer + fromIndex, pData->length - fromIndex, literal.data,
2078  literal.size);
2079  return n < 0 ? n : n + fromIndex;
2080  }
2081 #endif
2082 
2106  sal_Int32 indexOfAsciiL(
2107  char const * str, sal_Int32 len, sal_Int32 fromIndex = 0) const
2108  {
2109  sal_Int32 ret = rtl_ustr_indexOfAscii_WithLength(
2110  pData->buffer + fromIndex, pData->length - fromIndex, str, len);
2111  return ret < 0 ? ret : ret + fromIndex;
2112  }
2113 
2114  // This overload is left undefined, to detect calls of indexOfAsciiL that
2115  // erroneously use RTL_CONSTASCII_USTRINGPARAM instead of
2116  // RTL_CONSTASCII_STRINGPARAM (but would lead to ambiguities on 32 bit
2117  // platforms):
2118 #if SAL_TYPES_SIZEOFLONG == 8
2119  void indexOfAsciiL(char const *, sal_Int32 len, rtl_TextEncoding) const;
2120 #endif
2121 
2137  sal_Int32 lastIndexOf( const OUString & str ) const
2138  {
2139  return rtl_ustr_lastIndexOfStr_WithLength( pData->buffer, pData->length,
2140  str.pData->buffer, str.pData->length );
2141  }
2142 
2160  sal_Int32 lastIndexOf( const OUString & str, sal_Int32 fromIndex ) const
2161  {
2162  return rtl_ustr_lastIndexOfStr_WithLength( pData->buffer, fromIndex,
2163  str.pData->buffer, str.pData->length );
2164  }
2165 
2171  template< typename T >
2173  {
2174  assert(
2177  pData->buffer, pData->length,
2180  }
2181 
2182 #if defined LIBO_INTERNAL_ONLY
2183 
2184  template<typename T>
2185  typename
2187  lastIndexOf(T & literal) const {
2189  pData->buffer, pData->length,
2192  }
2193 
2195  sal_Int32 lastIndexOf(OUStringLiteral const & literal) const {
2197  pData->buffer, pData->length, literal.data, literal.size);
2198  }
2199 #endif
2200 
2220  sal_Int32 lastIndexOfAsciiL(char const * str, sal_Int32 len) const
2221  {
2223  pData->buffer, pData->length, str, len);
2224  }
2225 
2236  SAL_WARN_UNUSED_RESULT OUString copy( sal_Int32 beginIndex ) const
2237  {
2238  return copy(beginIndex, getLength() - beginIndex);
2239  }
2240 
2253  SAL_WARN_UNUSED_RESULT OUString copy( sal_Int32 beginIndex, sal_Int32 count ) const
2254  {
2255  rtl_uString *pNew = NULL;
2256  rtl_uString_newFromSubString( &pNew, pData, beginIndex, count );
2257  return OUString( pNew, SAL_NO_ACQUIRE );
2258  }
2259 
2269  {
2270  rtl_uString* pNew = NULL;
2271  rtl_uString_newConcat( &pNew, pData, str.pData );
2272  return OUString( pNew, SAL_NO_ACQUIRE );
2273  }
2274 
2275 #ifndef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
2276  friend OUString operator+( const OUString& rStr1, const OUString& rStr2 )
2277  {
2278  return rStr1.concat( rStr2 );
2279  }
2280 #endif
2281 
2295  SAL_WARN_UNUSED_RESULT OUString replaceAt( sal_Int32 index, sal_Int32 count, const OUString& newStr ) const
2296  {
2297  rtl_uString* pNew = NULL;
2298  rtl_uString_newReplaceStrAt( &pNew, pData, index, count, newStr.pData );
2299  return OUString( pNew, SAL_NO_ACQUIRE );
2300  }
2301 
2316  {
2317  rtl_uString* pNew = NULL;
2318  rtl_uString_newReplace( &pNew, pData, oldChar, newChar );
2319  return OUString( pNew, SAL_NO_ACQUIRE );
2320  }
2321 
2341  OUString const & from, OUString const & to, sal_Int32 * index = NULL) const
2342  {
2343  rtl_uString * s = NULL;
2344  sal_Int32 i = 0;
2346  &s, pData, from.pData, to.pData, index == NULL ? &i : index);
2347  return OUString(s, SAL_NO_ACQUIRE);
2348  }
2349 
2368  template< typename T >
2370  sal_Int32 * index = NULL) const
2371  {
2373  rtl_uString * s = NULL;
2374  sal_Int32 i = 0;
2376  &s, pData,
2379  index == NULL ? &i : index);
2380  return OUString(s, SAL_NO_ACQUIRE);
2381  }
2382 
2401  template< typename T >
2403  sal_Int32 * index = NULL) const
2404  {
2406  rtl_uString * s = NULL;
2407  sal_Int32 i = 0;
2409  &s, pData, from.pData,
2412  index == NULL ? &i : index);
2413  return OUString(s, SAL_NO_ACQUIRE);
2414  }
2415 
2434  template< typename T1, typename T2 >
2436  replaceFirst( T1& from, T2& to, sal_Int32 * index = NULL) const
2437  {
2440  rtl_uString * s = NULL;
2441  sal_Int32 i = 0;
2443  &s, pData,
2448  index == NULL ? &i : index);
2449  return OUString(s, SAL_NO_ACQUIRE);
2450  }
2451 
2452 #if defined LIBO_INTERNAL_ONLY
2453 
2454  template<typename T> [[nodiscard]]
2455  typename
2457  replaceFirst(T & from, OUString const & to, sal_Int32 * index = nullptr)
2458  const
2459  {
2460  rtl_uString * s = nullptr;
2461  sal_Int32 i = 0;
2463  &s, pData,
2466  to.pData->buffer, to.pData->length, index == nullptr ? &i : index);
2467  if (s == nullptr) {
2468  throw std::bad_alloc();
2469  // should be std::length_error if resulting would be too large
2470  }
2471  return OUString(s, SAL_NO_ACQUIRE);
2472  }
2474  template<typename T> [[nodiscard]]
2475  typename
2476  libreoffice_internal::ConstCharArrayDetector<T, OUString>::TypeUtf16
2477  replaceFirst(OUString const & from, T & to, sal_Int32 * index = nullptr)
2478  const
2479  {
2480  rtl_uString * s = nullptr;
2481  sal_Int32 i = 0;
2483  &s, pData, from.pData->buffer, from.pData->length,
2484  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2485  libreoffice_internal::ConstCharArrayDetector<T>::length,
2486  index == nullptr ? &i : index);
2487  if (s == nullptr) {
2488  throw std::bad_alloc();
2489  // should be std::length_error if resulting would be too large
2490  }
2491  return OUString(s, SAL_NO_ACQUIRE);
2492  }
2494  template<typename T1, typename T2> [[nodiscard]]
2495  typename
2496  libreoffice_internal::ConstCharArrayDetector<
2497  T1,
2498  typename libreoffice_internal::ConstCharArrayDetector<
2499  T2, OUString>::TypeUtf16
2500  >::TypeUtf16
2501  replaceFirst(T1 & from, T2 & to, sal_Int32 * index = nullptr) const {
2502  rtl_uString * s = nullptr;
2503  sal_Int32 i = 0;
2505  &s, pData,
2506  libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2507  libreoffice_internal::ConstCharArrayDetector<T1>::length,
2508  libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2509  libreoffice_internal::ConstCharArrayDetector<T2>::length,
2510  index == nullptr ? &i : index);
2511  if (s == nullptr) {
2512  throw std::bad_alloc();
2513  // should be std::length_error if resulting would be too large
2514  }
2515  return OUString(s, SAL_NO_ACQUIRE);
2516  }
2518  template<typename T1, typename T2> [[nodiscard]]
2519  typename
2520  libreoffice_internal::ConstCharArrayDetector<
2521  T1,
2522  typename libreoffice_internal::ConstCharArrayDetector<
2523  T2, OUString>::Type
2524  >::TypeUtf16
2525  replaceFirst(T1 & from, T2 & to, sal_Int32 * index = nullptr) const {
2526  rtl_uString * s = nullptr;
2527  sal_Int32 i = 0;
2529  &s, pData,
2530  libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2531  libreoffice_internal::ConstCharArrayDetector<T1>::length,
2532  libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2533  libreoffice_internal::ConstCharArrayDetector<T2>::length,
2534  index == nullptr ? &i : index);
2535  if (s == nullptr) {
2536  throw std::bad_alloc();
2537  // should be std::length_error if resulting would be too large
2538  }
2539  return OUString(s, SAL_NO_ACQUIRE);
2540  }
2542  template<typename T1, typename T2> [[nodiscard]]
2543  typename
2544  libreoffice_internal::ConstCharArrayDetector<
2545  T1,
2546  typename libreoffice_internal::ConstCharArrayDetector<
2547  T2, OUString>::TypeUtf16
2548  >::Type
2549  replaceFirst(T1 & from, T2 & to, sal_Int32 * index = nullptr) const {
2550  rtl_uString * s = nullptr;
2551  sal_Int32 i = 0;
2553  &s, pData,
2554  libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2555  libreoffice_internal::ConstCharArrayDetector<T1>::length,
2556  libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2557  libreoffice_internal::ConstCharArrayDetector<T2>::length,
2558  index == nullptr ? &i : index);
2559  if (s == nullptr) {
2560  throw std::bad_alloc();
2561  // should be std::length_error if resulting would be too large
2562  }
2563  return OUString(s, SAL_NO_ACQUIRE);
2564  }
2565 
2567  [[nodiscard]] OUString replaceFirst(
2568  OUStringLiteral const & from, OUString const & to,
2569  sal_Int32 * index = nullptr) const
2570  {
2571  rtl_uString * s = nullptr;
2572  sal_Int32 i = 0;
2574  &s, pData, from.data, from.size, to.pData,
2575  index == nullptr ? &i : index);
2576  return OUString(s, SAL_NO_ACQUIRE);
2577  }
2579  [[nodiscard]] OUString replaceFirst(
2580  OUString const & from, OUStringLiteral const & to,
2581  sal_Int32 * index = nullptr) const
2582  {
2583  rtl_uString * s = nullptr;
2584  sal_Int32 i = 0;
2586  &s, pData, from.pData, to.data, to.size,
2587  index == nullptr ? &i : index);
2588  return OUString(s, SAL_NO_ACQUIRE);
2589  }
2591  [[nodiscard]] OUString replaceFirst(
2592  OUStringLiteral const & from, OUStringLiteral const & to,
2593  sal_Int32 * index = nullptr) const
2594  {
2595  rtl_uString * s = nullptr;
2596  sal_Int32 i = 0;
2598  &s, pData, from.data, from.size, to.data, to.size,
2599  index == nullptr ? &i : index);
2600  return OUString(s, SAL_NO_ACQUIRE);
2601  }
2603  template<typename T> [[nodiscard]]
2604  typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2605  replaceFirst(
2606  OUStringLiteral const & from, T & to, sal_Int32 * index = nullptr) const
2607  {
2608  assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2609  rtl_uString * s = nullptr;
2610  sal_Int32 i = 0;
2612  &s, pData, from.data, from.size,
2613  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2614  libreoffice_internal::ConstCharArrayDetector<T>::length,
2615  index == nullptr ? &i : index);
2616  return OUString(s, SAL_NO_ACQUIRE);
2617  }
2619  template<typename T> [[nodiscard]]
2620  typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2621  replaceFirst(
2622  T & from, OUStringLiteral const & to, sal_Int32 * index = nullptr) const
2623  {
2624  assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2625  rtl_uString * s = nullptr;
2626  sal_Int32 i = 0;
2628  &s, pData,
2629  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2630  libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2631  to.size, index == nullptr ? &i : index);
2632  return OUString(s, SAL_NO_ACQUIRE);
2633  }
2635  template<typename T> [[nodiscard]]
2636  typename
2637  libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2638  replaceFirst(
2639  OUStringLiteral const & from, T & to, sal_Int32 * index = nullptr) const
2640  {
2641  assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2642  rtl_uString * s = nullptr;
2643  sal_Int32 i = 0;
2645  &s, pData, from.data, from.size,
2646  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2647  libreoffice_internal::ConstCharArrayDetector<T>::length,
2648  index == nullptr ? &i : index);
2649  return OUString(s, SAL_NO_ACQUIRE);
2650  }
2652  template<typename T> [[nodiscard]]
2653  typename
2654  libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2655  replaceFirst(
2656  T & from, OUStringLiteral const & to, sal_Int32 * index = nullptr) const
2657  {
2658  assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2659  rtl_uString * s = nullptr;
2660  sal_Int32 i = 0;
2662  &s, pData,
2663  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2664  libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2665  to.size, index == nullptr ? &i : index);
2666  return OUString(s, SAL_NO_ACQUIRE);
2667  }
2668 #endif
2669 
2686  OUString const & from, OUString const & to, sal_Int32 fromIndex = 0) const
2687  {
2688  rtl_uString * s = NULL;
2689  rtl_uString_newReplaceAllFromIndex(&s, pData, from.pData, to.pData, fromIndex);
2690  return OUString(s, SAL_NO_ACQUIRE);
2691  }
2692 
2706  template< typename T >
2708  {
2710  rtl_uString * s = NULL;
2712  &s, pData,
2715  return OUString(s, SAL_NO_ACQUIRE);
2716  }
2717 
2731  template< typename T >
2733  {
2735  rtl_uString * s = NULL;
2737  &s, pData, from.pData,
2740  return OUString(s, SAL_NO_ACQUIRE);
2741  }
2742 
2756  template< typename T1, typename T2 >
2758  replaceAll( T1& from, T2& to ) const
2759  {
2762  rtl_uString * s = NULL;
2764  &s, pData,
2769  return OUString(s, SAL_NO_ACQUIRE);
2770  }
2771 
2772 #if defined LIBO_INTERNAL_ONLY
2773 
2774  template<typename T> [[nodiscard]]
2775  typename
2777  replaceAll(T & from, OUString const & to) const {
2778  rtl_uString * s = nullptr;
2780  &s, pData,
2783  to.pData->buffer, to.pData->length);
2784  if (s == nullptr) {
2785  throw std::bad_alloc();
2786  // should be std::length_error if resulting would be too large
2787  }
2788  return OUString(s, SAL_NO_ACQUIRE);
2789  }
2791  template<typename T> [[nodiscard]]
2792  typename
2793  libreoffice_internal::ConstCharArrayDetector<T, OUString>::TypeUtf16
2794  replaceAll(OUString const & from, T & to) const {
2795  rtl_uString * s = nullptr;
2797  &s, pData, from.pData->buffer, from.pData->length,
2798  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2799  libreoffice_internal::ConstCharArrayDetector<T>::length);
2800  if (s == nullptr) {
2801  throw std::bad_alloc();
2802  // should be std::length_error if resulting would be too large
2803  }
2804  return OUString(s, SAL_NO_ACQUIRE);
2805  }
2807  template<typename T1, typename T2> [[nodiscard]]
2808  typename
2809  libreoffice_internal::ConstCharArrayDetector<
2810  T1,
2811  typename libreoffice_internal::ConstCharArrayDetector<
2812  T2, OUString>::TypeUtf16
2813  >::TypeUtf16
2814  replaceAll(T1 & from, T2 & to) const {
2815  rtl_uString * s = nullptr;
2817  &s, pData,
2818  libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2819  libreoffice_internal::ConstCharArrayDetector<T1>::length,
2820  libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2821  libreoffice_internal::ConstCharArrayDetector<T2>::length);
2822  if (s == nullptr) {
2823  throw std::bad_alloc();
2824  // should be std::length_error if resulting would be too large
2825  }
2826  return OUString(s, SAL_NO_ACQUIRE);
2827  }
2829  template<typename T1, typename T2> [[nodiscard]]
2830  typename
2831  libreoffice_internal::ConstCharArrayDetector<
2832  T1,
2833  typename libreoffice_internal::ConstCharArrayDetector<
2834  T2, OUString>::Type
2835  >::TypeUtf16
2836  replaceAll(T1 & from, T2 & to) const {
2837  rtl_uString * s = nullptr;
2839  &s, pData,
2840  libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2841  libreoffice_internal::ConstCharArrayDetector<T1>::length,
2842  libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2843  libreoffice_internal::ConstCharArrayDetector<T2>::length);
2844  if (s == nullptr) {
2845  throw std::bad_alloc();
2846  // should be std::length_error if resulting would be too large
2847  }
2848  return OUString(s, SAL_NO_ACQUIRE);
2849  }
2851  template<typename T1, typename T2> [[nodiscard]]
2852  typename
2853  libreoffice_internal::ConstCharArrayDetector<
2854  T1,
2855  typename libreoffice_internal::ConstCharArrayDetector<
2856  T2, OUString>::TypeUtf16
2857  >::Type
2858  replaceAll(T1 & from, T2 & to) const {
2859  rtl_uString * s = nullptr;
2861  &s, pData,
2862  libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from),
2863  libreoffice_internal::ConstCharArrayDetector<T1>::length,
2864  libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to),
2865  libreoffice_internal::ConstCharArrayDetector<T2>::length);
2866  if (s == nullptr) {
2867  throw std::bad_alloc();
2868  // should be std::length_error if resulting would be too large
2869  }
2870  return OUString(s, SAL_NO_ACQUIRE);
2871  }
2872 
2874  [[nodiscard]] OUString replaceAll(
2875  OUStringLiteral const & from, OUString const & to) const
2876  {
2877  rtl_uString * s = nullptr;
2879  &s, pData, from.data, from.size, to.pData);
2880  return OUString(s, SAL_NO_ACQUIRE);
2881  }
2883  [[nodiscard]] OUString replaceAll(
2884  OUString const & from, OUStringLiteral const & to) const
2885  {
2886  rtl_uString * s = nullptr;
2888  &s, pData, from.pData, to.data, to.size);
2889  return OUString(s, SAL_NO_ACQUIRE);
2890  }
2892  [[nodiscard]] OUString replaceAll(
2893  OUStringLiteral const & from, OUStringLiteral const & to) const
2894  {
2895  rtl_uString * s = nullptr;
2897  &s, pData, from.data, from.size, to.data, to.size);
2898  return OUString(s, SAL_NO_ACQUIRE);
2899  }
2901  template<typename T> [[nodiscard]]
2902  typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2903  replaceAll(OUStringLiteral const & from, T & to) const {
2904  assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2905  rtl_uString * s = nullptr;
2907  &s, pData, from.data, from.size,
2908  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2909  libreoffice_internal::ConstCharArrayDetector<T>::length);
2910  return OUString(s, SAL_NO_ACQUIRE);
2911  }
2913  template<typename T> [[nodiscard]]
2914  typename libreoffice_internal::ConstCharArrayDetector<T, OUString >::Type
2915  replaceAll(T & from, OUStringLiteral const & to) const {
2916  assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2917  rtl_uString * s = nullptr;
2919  &s, pData,
2920  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2921  libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2922  to.size);
2923  return OUString(s, SAL_NO_ACQUIRE);
2924  }
2926  template<typename T> [[nodiscard]]
2927  typename
2928  libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2929  replaceAll(OUStringLiteral const & from, T & to) const {
2930  assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to));
2931  rtl_uString * s = nullptr;
2933  &s, pData, from.data, from.size,
2934  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to),
2935  libreoffice_internal::ConstCharArrayDetector<T>::length);
2936  return OUString(s, SAL_NO_ACQUIRE);
2937  }
2939  template<typename T> [[nodiscard]]
2940  typename
2941  libreoffice_internal::ConstCharArrayDetector<T, OUString >::TypeUtf16
2942  replaceAll(T & from, OUStringLiteral const & to) const {
2943  assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from));
2944  rtl_uString * s = nullptr;
2946  &s, pData,
2947  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from),
2948  libreoffice_internal::ConstCharArrayDetector<T>::length, to.data,
2949  to.size);
2950  return OUString(s, SAL_NO_ACQUIRE);
2951  }
2952 #endif
2953 
2965  {
2966  rtl_uString* pNew = NULL;
2967  rtl_uString_newToAsciiLowerCase( &pNew, pData );
2968  return OUString( pNew, SAL_NO_ACQUIRE );
2969  }
2970 
2982  {
2983  rtl_uString* pNew = NULL;
2984  rtl_uString_newToAsciiUpperCase( &pNew, pData );
2985  return OUString( pNew, SAL_NO_ACQUIRE );
2986  }
2987 
3002  {
3003  rtl_uString* pNew = NULL;
3004  rtl_uString_newTrim( &pNew, pData );
3005  return OUString( pNew, SAL_NO_ACQUIRE );
3006  }
3007 
3032  OUString getToken( sal_Int32 token, sal_Unicode cTok, sal_Int32& index ) const
3033  {
3034  rtl_uString * pNew = NULL;
3035  index = rtl_uString_getToken( &pNew, pData, token, cTok, index );
3036  return OUString( pNew, SAL_NO_ACQUIRE );
3037  }
3038 
3052  OUString getToken(sal_Int32 count, sal_Unicode separator) const {
3053  sal_Int32 n = 0;
3054  return getToken(count, separator, n);
3055  }
3056 
3065  bool toBoolean() const
3066  {
3067  return rtl_ustr_toBoolean( pData->buffer );
3068  }
3069 
3077  {
3078  return pData->buffer[0];
3079  }
3080 
3091  sal_Int32 toInt32( sal_Int16 radix = 10 ) const
3092  {
3093  return rtl_ustr_toInt32( pData->buffer, radix );
3094  }
3095 
3108  sal_uInt32 toUInt32( sal_Int16 radix = 10 ) const
3109  {
3110  return rtl_ustr_toUInt32( pData->buffer, radix );
3111  }
3112 
3123  sal_Int64 toInt64( sal_Int16 radix = 10 ) const
3124  {
3125  return rtl_ustr_toInt64( pData->buffer, radix );
3126  }
3127 
3140  sal_uInt64 toUInt64( sal_Int16 radix = 10 ) const
3141  {
3142  return rtl_ustr_toUInt64( pData->buffer, radix );
3143  }
3144 
3153  float toFloat() const
3154  {
3155  return rtl_ustr_toFloat( pData->buffer );
3156  }
3157 
3166  double toDouble() const
3167  {
3168  return rtl_ustr_toDouble( pData->buffer );
3169  }
3170 
3171 
3188  {
3189  rtl_uString * pNew = NULL;
3190  rtl_uString_intern( &pNew, pData );
3191  if (pNew == NULL) {
3192  throw std::bad_alloc();
3193  }
3194  return OUString( pNew, SAL_NO_ACQUIRE );
3195  }
3196 
3222  static OUString intern( const sal_Char * value, sal_Int32 length,
3223  rtl_TextEncoding encoding,
3224  sal_uInt32 convertFlags = OSTRING_TO_OUSTRING_CVTFLAGS,
3225  sal_uInt32 *pInfo = NULL )
3226  {
3227  rtl_uString * pNew = NULL;
3228  rtl_uString_internConvert( &pNew, value, length, encoding,
3229  convertFlags, pInfo );
3230  if (pNew == NULL) {
3231  throw std::bad_alloc();
3232  }
3233  return OUString( pNew, SAL_NO_ACQUIRE );
3234  }
3235 
3260  bool convertToString(OString * pTarget, rtl_TextEncoding nEncoding,
3261  sal_uInt32 nFlags) const
3262  {
3263  return rtl_convertUStringToString(&pTarget->pData, pData->buffer,
3264  pData->length, nEncoding, nFlags);
3265  }
3266 
3318  sal_uInt32 iterateCodePoints(
3319  sal_Int32 * indexUtf16, sal_Int32 incrementCodePoints = 1) const
3320  {
3322  pData, indexUtf16, incrementCodePoints);
3323  }
3324 
3334  static OUString fromUtf8(const OString& rSource)
3335  {
3336  OUString aTarget;
3337  bool bSuccess = rtl_convertStringToUString(&aTarget.pData,
3338  rSource.getStr(),
3339  rSource.getLength(),
3342  (void) bSuccess;
3343  assert(bSuccess);
3344  return aTarget;
3345  }
3346 
3357  OString toUtf8() const
3358  {
3359  OString aTarget;
3360  bool bSuccess = rtl_convertUStringToString(&aTarget.pData,
3361  getStr(),
3362  getLength(),
3365  (void) bSuccess;
3366  assert(bSuccess);
3367  return aTarget;
3368  }
3369 
3370 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
3371 
3372  static OUStringNumber< int > number( int i, sal_Int16 radix = 10 )
3373  {
3374  return OUStringNumber< int >( i, radix );
3375  }
3376  static OUStringNumber< long long > number( long long ll, sal_Int16 radix = 10 )
3377  {
3378  return OUStringNumber< long long >( ll, radix );
3379  }
3380  static OUStringNumber< unsigned long long > number( unsigned long long ll, sal_Int16 radix = 10 )
3381  {
3382  return OUStringNumber< unsigned long long >( ll, radix );
3383  }
3384  static OUStringNumber< unsigned long long > number( unsigned int i, sal_Int16 radix = 10 )
3385  {
3386  return number( static_cast< unsigned long long >( i ), radix );
3387  }
3388  static OUStringNumber< long long > number( long i, sal_Int16 radix = 10)
3389  {
3390  return number( static_cast< long long >( i ), radix );
3391  }
3392  static OUStringNumber< unsigned long long > number( unsigned long i, sal_Int16 radix = 10 )
3393  {
3394  return number( static_cast< unsigned long long >( i ), radix );
3395  }
3396  static OUStringNumber< float > number( float f )
3397  {
3398  return OUStringNumber< float >( f );
3399  }
3400  static OUStringNumber< double > number( double d )
3401  {
3402  return OUStringNumber< double >( d );
3403  }
3404 #else
3405 
3415  static OUString number( int i, sal_Int16 radix = 10 )
3416  {
3418  return OUString(aBuf, rtl_ustr_valueOfInt32(aBuf, i, radix));
3419  }
3422  static OUString number( unsigned int i, sal_Int16 radix = 10 )
3423  {
3424  return number( static_cast< unsigned long long >( i ), radix );
3425  }
3428  static OUString number( long i, sal_Int16 radix = 10)
3429  {
3430  return number( static_cast< long long >( i ), radix );
3431  }
3434  static OUString number( unsigned long i, sal_Int16 radix = 10 )
3435  {
3436  return number( static_cast< unsigned long long >( i ), radix );
3437  }
3440  static OUString number( long long ll, sal_Int16 radix = 10 )
3441  {
3443  return OUString(aBuf, rtl_ustr_valueOfInt64(aBuf, ll, radix));
3444  }
3447  static OUString number( unsigned long long ll, sal_Int16 radix = 10 )
3448  {
3450  return OUString(aBuf, rtl_ustr_valueOfUInt64(aBuf, ll, radix));
3451  }
3452 
3462  static OUString number( float f )
3463  {
3465  return OUString(aBuf, rtl_ustr_valueOfFloat(aBuf, f));
3466  }
3467 
3477  static OUString number( double d )
3478  {
3480  return OUString(aBuf, rtl_ustr_valueOfDouble(aBuf, d));
3481  }
3482 #endif
3483 
3495  SAL_DEPRECATED("use boolean()") static OUString valueOf( sal_Bool b )
3496  {
3497  return boolean(b);
3498  }
3499 
3511  static OUString boolean( bool b )
3512  {
3514  return OUString(aBuf, rtl_ustr_valueOfBoolean(aBuf, b));
3515  }
3516 
3524  SAL_DEPRECATED("convert to OUString or use directly") static OUString valueOf( sal_Unicode c )
3525  {
3526  return OUString( &c, 1 );
3527  }
3528 
3539  SAL_DEPRECATED("use number()") static OUString valueOf( sal_Int32 i, sal_Int16 radix = 10 )
3540  {
3541  return number( i, radix );
3542  }
3543 
3554  SAL_DEPRECATED("use number()") static OUString valueOf( sal_Int64 ll, sal_Int16 radix = 10 )
3555  {
3556  return number( ll, radix );
3557  }
3558 
3568  SAL_DEPRECATED("use number()") static OUString valueOf( float f )
3569  {
3570  return number(f);
3571  }
3572 
3582  SAL_DEPRECATED("use number()") static OUString valueOf( double d )
3583  {
3584  return number(d);
3585  }
3586 
3602  static OUString createFromAscii( const sal_Char * value )
3603  {
3604  rtl_uString* pNew = NULL;
3605  rtl_uString_newFromAscii( &pNew, value );
3606  return OUString( pNew, SAL_NO_ACQUIRE );
3607  }
3608 
3609 #if defined LIBO_INTERNAL_ONLY
3610  operator std::u16string_view() const { return {getStr(), sal_uInt32(getLength())}; }
3611 #endif
3612 
3613 private:
3614  OUString & internalAppend( rtl_uString* pOtherData )
3615  {
3616  rtl_uString* pNewData = NULL;
3617  rtl_uString_newConcat( &pNewData, pData, pOtherData );
3618  if (pNewData == NULL) {
3619  throw std::bad_alloc();
3620  }
3621  rtl_uString_assign(&pData, pNewData);
3622  rtl_uString_release(pNewData);
3623  return *this;
3624  }
3625 
3626 };
3627 
3628 #if defined LIBO_INTERNAL_ONLY
3629 // Prevent the operator ==/!= overloads with 'sal_Unicode const *' parameter from
3630 // being selected for nonsensical code like
3631 //
3632 // if (ouIdAttr == nullptr)
3633 //
3634 void operator ==(OUString const &, std::nullptr_t) = delete;
3635 void operator ==(std::nullptr_t, OUString const &) = delete;
3636 void operator !=(OUString const &, std::nullptr_t) = delete;
3637 void operator !=(std::nullptr_t, OUString const &) = delete;
3638 #endif
3639 
3640 #if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
3641 
3646 template<>
3647 struct ToStringHelper< OUString >
3648  {
3649  static std::size_t length( const OUString& s ) { return s.getLength(); }
3650  static sal_Unicode* addData( sal_Unicode* buffer, const OUString& s ) { return addDataHelper( buffer, s.getStr(), s.getLength()); }
3651  static const bool allowOStringConcat = false;
3652  static const bool allowOUStringConcat = true;
3653  };
3654 
3658 template<>
3659 struct ToStringHelper< OUStringLiteral >
3660  {
3661  static std::size_t length( const OUStringLiteral& str ) { return str.size; }
3662  static sal_Unicode* addData( sal_Unicode* buffer, const OUStringLiteral& str ) { return addDataLiteral( buffer, str.data, str.size ); }
3663  static const bool allowOStringConcat = false;
3664  static const bool allowOUStringConcat = true;
3665  };
3666 
3670 template< typename charT, typename traits, typename T1, typename T2 >
3671 inline std::basic_ostream<charT, traits> & operator <<(
3672  std::basic_ostream<charT, traits> & stream, OUStringConcat< T1, T2 >&& concat)
3673 {
3674  return stream << OUString( std::move(concat) );
3675 }
3676 
3678 #endif
3679 
3686 {
3696  size_t operator()(const OUString& rString) const
3697  { return static_cast<size_t>(rString.hashCode()); }
3698 };
3699 
3700 /* ======================================================================= */
3701 
3719 inline OUString OStringToOUString( const OString & rStr,
3720  rtl_TextEncoding encoding,
3721  sal_uInt32 convertFlags = OSTRING_TO_OUSTRING_CVTFLAGS )
3722 {
3723  return OUString( rStr.getStr(), rStr.getLength(), encoding, convertFlags );
3724 }
3725 
3743 inline OString OUStringToOString( const OUString & rUnicode,
3744  rtl_TextEncoding encoding,
3745  sal_uInt32 convertFlags = OUSTRING_TO_OSTRING_CVTFLAGS )
3746 {
3747  return OString( rUnicode.getStr(), rUnicode.getLength(), encoding, convertFlags );
3748 }
3749 
3750 /* ======================================================================= */
3751 
3760 template< typename charT, typename traits >
3761 inline std::basic_ostream<charT, traits> & operator <<(
3762  std::basic_ostream<charT, traits> & stream, OUString const & rString)
3763 {
3764  return stream <<
3766  // best effort; potentially loses data due to conversion failures
3767  // (stray surrogate halves) and embedded null characters
3768 }
3769 
3770 } // namespace
3771 
3772 #ifdef RTL_STRING_UNITTEST
3773 namespace rtl
3774 {
3775 typedef rtlunittest::OUString OUString;
3776 }
3777 #endif
3778 
3779 // In internal code, allow to use classes like OUString without having to
3780 // explicitly refer to the rtl namespace, which is kind of superfluous given
3781 // that OUString itself is namespaced by its OU prefix:
3782 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
3783 using ::rtl::OUString;
3784 using ::rtl::OUStringHash;
3787 using ::rtl::OUStringLiteral;
3788 using ::rtl::OUStringChar;
3789 #endif
3790 
3792 
3797 #if defined LIBO_INTERNAL_ONLY
3798 namespace std {
3799 
3800 template<>
3801 struct hash<::rtl::OUString>
3802 {
3803  std::size_t operator()(::rtl::OUString const & s) const
3804  { return std::size_t(s.hashCode()); }
3805 };
3806 
3807 }
3808 
3809 #endif
3810 
3812 #endif /* _RTL_USTRING_HXX */
3813 
3814 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl_uString_newReplaceAllAsciiLAsciiL
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.
rtl_uString_newToAsciiUpperCase
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.
rtl_ustr_toUInt64
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.
rtl::OUString::copy
SAL_WARN_UNUSED_RESULT OUString copy(sal_Int32 beginIndex) const
Returns a new string that is a substring of this string.
Definition: ustring.hxx:2236
rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength
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.
rtl::OUString::lastIndexOf
sal_Int32 lastIndexOf(const OUString &str, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition: ustring.hxx:2160
rtl_ustr_valueOfInt64
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_Char
char sal_Char
A legacy synonym for char.
Definition: types.h:116
rtl::OUString::replaceAll
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceAll(T &from, OUString const &to) const
Returns a new string resulting from replacing all occurrences of a given substring with another subst...
Definition: ustring.hxx:2707
rtl_uString_newReplaceAllUtf16LUtf16L
SAL_DLLPUBLIC void rtl_uString_newReplaceAllUtf16LUtf16L(rtl_uString **newStr, rtl_uString *str, sal_Unicode const *from, sal_Int32 fromLength, sal_Unicode const *to, sal_Int32 toLength) SAL_THROW_EXTERN_C()
Create a new string by replacing all occurrences of a given substring with another substring.
rtl_convertStringToUString
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.
salhelper::operator>
bool operator>(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:100
rtl::OUString::startsWith
bool startsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string starts with a given substring.
Definition: ustring.hxx:1342
rtl::OUString::replaceAll
SAL_WARN_UNUSED_RESULT OUString replaceAll(OUString const &from, OUString const &to, sal_Int32 fromIndex=0) const
Returns a new string resulting from replacing all occurrences of a given substring with another subst...
Definition: ustring.hxx:2685
rtl::OUString::indexOf
sal_Int32 indexOf(sal_Unicode ch, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified character,...
Definition: ustring.hxx:1982
rtl_string2UString
SAL_DLLPUBLIC void rtl_string2UString(rtl_uString **newStr, const sal_Char *str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags) SAL_THROW_EXTERN_C()
Create a new Unicode string by converting a byte string, using a specific text encoding.
rtl::OUString::lastIndexOfAsciiL
sal_Int32 lastIndexOfAsciiL(char const *str, sal_Int32 len) const
Returns the index within this string of the last occurrence of the specified ASCII substring.
Definition: ustring.hxx:2220
rtl::OUString::toUInt64
sal_uInt64 toUInt64(sal_Int16 radix=10) const
Returns the uint64 value from this string.
Definition: ustring.hxx:3140
rtl::OUString
This String class provides base functionality for C++ like Unicode character array handling.
Definition: ustring.hxx:127
rtl::OUString::startsWithIgnoreAsciiCase
bool startsWithIgnoreAsciiCase(OUString const &str, OUString *rest=NULL) const
Check whether this string starts with a given string, ignoring the case of ASCII letters.
Definition: ustring.hxx:1432
rtl::OUString::matchIgnoreAsciiCaseAsciiL
bool matchIgnoreAsciiCaseAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string, ignoring the case of ASCII letters.
Definition: ustring.hxx:1313
rtl::OUString::equalsIgnoreAsciiCase
bool equalsIgnoreAsciiCase(const OUString &str) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:844
rtl_uString_newReplaceStrAt
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.
rtl_TextEncoding
sal_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition: textenc.h:33
rtl::OUString::getToken
OUString getToken(sal_Int32 count, sal_Unicode separator) const
Returns a token from the string.
Definition: ustring.hxx:3052
RTL_USTR_MAX_VALUEOFUINT64
#define RTL_USTR_MAX_VALUEOFUINT64
Definition: ustring.h:1003
rtl::OUString::lastIndexOf
libreoffice_internal::ConstCharArrayDetector< T, sal_Int32 >::Type lastIndexOf(T &literal) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:2172
rtl::OUString::toInt64
sal_Int64 toInt64(sal_Int16 radix=10) const
Returns the int64 value from this string.
Definition: ustring.hxx:3123
rtl_uString_newFromStr_WithLength
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.
rtl::OUString::number
static OUString number(unsigned int i, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:3422
rtl::OUString::toChar
sal_Unicode toChar() const
Returns the first character from this string.
Definition: ustring.hxx:3076
rtl_uString_iterateCodePoints
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.
RTL_USTR_MAX_VALUEOFDOUBLE
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition: ustring.h:1041
SAL_NO_ACQUIRE
@ SAL_NO_ACQUIRE
definition of a no acquire enum for ctors
Definition: types.h:370
textenc.h
rtl::OString
This String class provide base functionality for C++ like 8-Bit character array handling.
Definition: string.hxx:98
rtl_ustr_indexOfStr_WithLength
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.
rtl::OUString::concat
SAL_WARN_UNUSED_RESULT OUString concat(const OUString &str) const
Concatenates the specified string to the end of this string.
Definition: ustring.hxx:2268
salhelper::operator<
bool operator<(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:90
rtl::OUString::~OUString
~OUString()
Release the string data.
Definition: ustring.hxx:434
rtl::OUString::compareTo
sal_Int32 compareTo(const OUString &str) const
Compares two strings.
Definition: ustring.hxx:729
rtl::OStringToOUString
OUString OStringToOUString(const OString &rStr, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OSTRING_TO_OUSTRING_CVTFLAGS)
Convert an OString to an OUString, using a specific text encoding.
Definition: ustring.hxx:3719
rtl::OUString::OUString
OUString(rtl_uString *str, __sal_NoAcquire)
New OUString from OUString data without acquiring it.
Definition: ustring.hxx:187
rtl::OUString::toFloat
float toFloat() const
Returns the float value from this string.
Definition: ustring.hxx:3153
rtl_ustr_indexOfChar_WithLength
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.
rtl::OUString::iterateCodePoints
sal_uInt32 iterateCodePoints(sal_Int32 *indexUtf16, sal_Int32 incrementCodePoints=1) const
Iterate through this string based on code points instead of UTF-16 code units.
Definition: ustring.hxx:3318
rtl_ustr_lastIndexOfAscii_WithLength
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.
rtl::OUString::replaceFirst
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceFirst(T &from, OUString const &to, sal_Int32 *index=NULL) const
Returns a new string resulting from replacing the first occurrence of a given substring with another ...
Definition: ustring.hxx:2369
rtl_ustr_valueOfUInt64
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.
rtl::OUString::OUString
OUString(const sal_Unicode *value, sal_Int32 length)
New string from a Unicode character buffer array.
Definition: ustring.hxx:231
rtl::OUString::number
static OUString number(double d)
Returns the string representation of the double argument.
Definition: ustring.hxx:3477
rtl::OUString::compareToIgnoreAsciiCaseAscii
sal_Int32 compareToIgnoreAsciiCaseAscii(const sal_Char *asciiStr) const
Compares two ASCII strings ignoring case.
Definition: ustring.hxx:1221
rtl_uString_newReplaceAllUtf16LAsciiL
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.
rtl::OUString::getLength
sal_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:678
rtl::OUString::matchAsciiL
bool matchAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition: ustring.hxx:1275
rtl_uString_newReplaceFirstUtf16LAsciiL
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.
rtl::OUString::operator!=
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1818
rtl::OUString::operator+=
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:558
rtl::OUString::reverseCompareTo
sal_Int32 reverseCompareTo(const OUString &str) const
Compares two strings in reverse order.
Definition: ustring.hxx:768
SAL_WARN_UNUSED
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:576
rtl::OUString::matchIgnoreAsciiCase
bool matchIgnoreAsciiCase(const OUString &str, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string, ignoring the case of ASCII letters.
Definition: ustring.hxx:1003
rtl::OUString::isEmpty
bool isEmpty() const
Checks if a string is empty.
Definition: ustring.hxx:688
rtl_uString_newFromSubString
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.
rtl::OUString::lastIndexOf
sal_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition: ustring.hxx:1997
OUSTRING_TO_OSTRING_CVTFLAGS
#define OUSTRING_TO_OSTRING_CVTFLAGS
Definition: string.h:1350
rtl::OUString::equals
bool equals(const OUString &str) const
Perform a comparison of two strings.
Definition: ustring.hxx:820
rtl::OUString::copy
SAL_WARN_UNUSED_RESULT OUString copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string that is a substring of this string.
Definition: ustring.hxx:2253
rtl::OUStringToOString
OString OUStringToOString(const OUString &rUnicode, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OUSTRING_TO_OSTRING_CVTFLAGS)
Convert an OUString to an OString, using a specific text encoding.
Definition: ustring.hxx:3743
rtl::OUString::endsWith
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type endsWith(T &literal, OUString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:1535
rtl_uString_newReplaceFirstAsciiLAsciiL
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.
rtl_ustr_asciil_reverseCompare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_asciil_reverseCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Char *second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
Compare two strings from back to front.
rtl::OUString::replace
SAL_WARN_UNUSED_RESULT OUString replace(sal_Unicode oldChar, sal_Unicode newChar) const
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
Definition: ustring.hxx:2315
string.hxx
com::sun::star::uno::operator!=
bool operator!=(const Any &rAny, const C &value)
Template inequality operator: compares set value of left side any to right side value.
Definition: Any.hxx:664
rtl::OUString::toDouble
double toDouble() const
Returns the double value from this string.
Definition: ustring.hxx:3166
rtl::OUString::clear
void clear()
Clears the string, i.e, makes a zero-character string.
Definition: ustring.hxx:665
rtl::OUString::indexOfAsciiL
sal_Int32 indexOfAsciiL(char const *str, sal_Int32 len, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified ASCII substring,...
Definition: ustring.hxx:2106
rtl_uString_intern
SAL_DLLPUBLIC void rtl_uString_intern(rtl_uString **newStr, rtl_uString *str) SAL_THROW_EXTERN_C()
Return a canonical representation for a string.
sal_Bool
unsigned char sal_Bool
Definition: types.h:34
ustring.h
rtl::OUString::matchIgnoreAsciiCase
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type matchIgnoreAsciiCase(T &literal, sal_Int32 fromIndex=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:1016
config.h
rtl_ustr_toUInt32
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.
rtl_uString_newReplaceFirstToAsciiL
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.
rtl::OUString::replaceFirst
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T1, typename libreoffice_internal::ConstCharArrayDetector< T2, OUString >::Type >::Type replaceFirst(T1 &from, T2 &to, sal_Int32 *index=NULL) const
Returns a new string resulting from replacing the first occurrence of a given substring with another ...
Definition: ustring.hxx:2436
rtl::OUString::number
static OUString number(int i, sal_Int16 radix=10)
Returns the string representation of the integer argument.
Definition: ustring.hxx:3415
rtl_ustr_hashCode_WithLength
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.
rtl_uString_newFromStr
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.
rtl_uString_new
SAL_DLLPUBLIC void rtl_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
rtl_uString_assign
SAL_DLLPUBLIC void rtl_uString_assign(rtl_uString **str, rtl_uString *rightValue) SAL_THROW_EXTERN_C()
Assign a new value to a string.
rtl::OUString::equalsIgnoreAsciiCase
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type equalsIgnoreAsciiCase(T &literal) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:882
rtl_uString_newReplaceFirst
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.
rtl_uString_release
SAL_DLLPUBLIC void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
rtl::OUString::trim
SAL_WARN_UNUSED_RESULT OUString trim() const
Returns a new string resulting from removing white space from both ends of the string.
Definition: ustring.hxx:3001
rtl::OUString::equalsAscii
bool equalsAscii(const sal_Char *asciiStr) const
Perform a comparison of two strings.
Definition: ustring.hxx:1148
rtl::OUString::equalsIgnoreAsciiCaseAsciiL
bool equalsIgnoreAsciiCaseAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:1246
rtl_ustr_reverseCompare_WithLength
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.
rtl::OUString::compareTo
sal_Int32 compareTo(const OUString &str, sal_Int32 maxLength) const
Compares two strings with a maximum count of characters.
Definition: ustring.hxx:750
rtl_uString_newReplace
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.
rtl_ustr_lastIndexOfStr_WithLength
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.
rtl_convertUStringToString
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.
RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
#define RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
Definition: textcvt.h:71
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
#define RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
Definition: textcvt.h:147
rtl::OUString::number
static OUString number(long i, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:3428
RTL_USTR_MAX_VALUEOFBOOLEAN
#define RTL_USTR_MAX_VALUEOFBOOLEAN
Definition: ustring.h:915
rtl::OUString::lastIndexOf
sal_Int32 lastIndexOf(sal_Unicode ch, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified character,...
Definition: ustring.hxx:2014
rtl::OUString::number
static OUString number(float f)
Returns the string representation of the float argument.
Definition: ustring.hxx:3462
rtl_ustr_ascii_compare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Char *second) SAL_THROW_EXTERN_C()
Compare two strings.
rtl::OUString::intern
OUString intern() const
Return a canonical representation for a string.
Definition: ustring.hxx:3187
rtl::OUString::compareToAscii
sal_Int32 compareToAscii(const sal_Char *asciiStr) const
Compares two strings.
Definition: ustring.hxx:1073
rtl::OUString::OUString
OUString(const OUString &str)
New string from OUString.
Definition: ustring.hxx:147
rtl_uString_ensureCapacity
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.
rtl::OUString::operator!=
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator!=(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1802
rtl_ustr_ascii_shortenedCompare_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_shortenedCompare_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Char *second, sal_Int32 shortenedLen) SAL_THROW_EXTERN_C()
Compare two strings with a maximum count of characters.
rtl_uString_alloc
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.
rtl::OUString::compareToIgnoreAsciiCase
sal_Int32 compareToIgnoreAsciiCase(const OUString &str) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:869
rtl_ustr_toDouble
SAL_DLLPUBLIC double rtl_ustr_toDouble(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a double.
rtl
Definition: bootstrap.hxx:30
rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Char *second, sal_Int32 shortenedLen) SAL_THROW_EXTERN_C()
Compare two strings with a maximum count of characters, ignoring the case of ASCII characters.
rtl::OUString::number
static OUString number(long long ll, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:3440
rtl::OUString::startsWithIgnoreAsciiCase
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWithIgnoreAsciiCase(T &literal, OUString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:1449
rtl::OUString::toAsciiUpperCase
SAL_WARN_UNUSED_RESULT OUString toAsciiUpperCase() const
Converts from this string all ASCII lowercase characters (97-122) to ASCII uppercase characters (65-9...
Definition: ustring.hxx:2981
rtl_uString_getToken
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.
rtl_uString_newReplaceAllAsciiL
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.
rtl_ustr_compareIgnoreAsciiCase_WithLength
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.
rtl_uString_newConcat
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.
rtl::OUString::getStr
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:700
rtl::OUString::convertToString
bool convertToString(OString *pTarget, rtl_TextEncoding nEncoding, sal_uInt32 nFlags) const
Converts to an OString, signalling failure.
Definition: ustring.hxx:3260
__sal_NoAcquire
__sal_NoAcquire
Definition: types.h:367
RTL_USTR_MAX_VALUEOFINT64
#define RTL_USTR_MAX_VALUEOFINT64
Definition: ustring.h:980
rtl_ustr_valueOfBoolean
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
rtl::OUString::OUString
OUString(sal_uInt32 const *codePoints, sal_Int32 codePointCount)
Create a new string from an array of Unicode code points.
Definition: ustring.hxx:382
rtl::OUString::operator+
friend OUString operator+(const OUString &rStr1, const OUString &rStr2)
Definition: ustring.hxx:2276
rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength(const sal_Unicode *first, sal_Int32 firstLen, const sal_Char *second) SAL_THROW_EXTERN_C()
Compare two strings, ignoring the case of ASCII characters.
RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
#define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
Definition: textcvt.h:141
rtl_ustr_shortenedCompare_WithLength
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.
rtl::OUString::match
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type match(T &literal, sal_Int32 fromIndex=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:946
OSTRING_TO_OUSTRING_CVTFLAGS
#define OSTRING_TO_OUSTRING_CVTFLAGS
Definition: ustring.h:2145
rtl::OUString::lastIndexOf
sal_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition: ustring.hxx:2137
rtl::OUString::OUString
OUString(rtl_uString *str)
New string from OUString data.
Definition: ustring.hxx:173
SAL_DEPRECATED
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:463
rtl::OString::getStr
const sal_Char * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the characters of this string.
Definition: string.hxx:455
rtl_ustr_toInt32
SAL_DLLPUBLIC sal_Int32 rtl_ustr_toInt32(const sal_Unicode *str, sal_Int16 radix) SAL_THROW_EXTERN_C()
Interpret a string as an integer.
RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
#define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
Definition: textcvt.h:68
rtl::OUString::number
static OUString number(unsigned long long ll, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:3447
rtl::libreoffice_internal::Dummy
Definition: stringutils.hxx:130
rtl::OUString::endsWithAsciiL
bool endsWithAsciiL(char const *asciiStr, sal_Int32 asciiStrLength) const
Check whether this string ends with a given ASCII string.
Definition: ustring.hxx:1608
rtl_uString_newReplaceFirstAsciiLUtf16L
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.
rtl::OUString::OUString
OUString(const sal_Unicode *value)
New string from a Unicode character buffer array.
Definition: ustring.hxx:217
rtl::libreoffice_internal::ExceptCharArrayDetector::Type
Dummy Type
Definition: stringutils.hxx:301
rtl::OUString::startsWith
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWith(T &literal, OUString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:1356
rtl::OUString::toAsciiLowerCase
SAL_WARN_UNUSED_RESULT OUString toAsciiLowerCase() const
Converts from this string all ASCII uppercase characters (65-90) to ASCII lowercase characters (97-12...
Definition: ustring.hxx:2964
rtl::libreoffice_internal::ConstCharArrayDetector
Definition: stringutils.hxx:185
rtl::OUString::endsWith
bool endsWith(OUString const &str, OUString *rest=NULL) const
Check whether this string ends with a given substring.
Definition: ustring.hxx:1519
rtl_ustr_valueOfFloat
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfFloat(sal_Unicode *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
rtl_ustr_compare_WithLength
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.
rtl::OUString::replaceFirst
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceFirst(OUString const &from, T &to, sal_Int32 *index=NULL) const
Returns a new string resulting from replacing the first occurrence of a given substring with another ...
Definition: ustring.hxx:2402
rtl_ustr_lastIndexOfChar_WithLength
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.
rtl::OUString::endsWithIgnoreAsciiCaseAsciiL
bool endsWithIgnoreAsciiCaseAsciiL(char const *asciiStr, sal_Int32 asciiStrLength) const
Check whether this string ends with a given ASCII string, ignoring the case of ASCII letters.
Definition: ustring.hxx:1729
rtl::OUString::equalsAsciiL
bool equalsAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Perform a comparison of two strings.
Definition: ustring.hxx:1171
SAL_WARN_UNUSED_RESULT
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:298
rtl_uString_newFromLiteral
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const sal_Char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
RTL_USTR_MAX_VALUEOFFLOAT
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition: ustring.h:1022
rtl::OUString::reverseCompareTo
libreoffice_internal::ConstCharArrayDetector< T, sal_Int32 >::Type reverseCompareTo(T &literal) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:780
rtl_uString_newFromCodePoints
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.
rtl::OString::getLength
sal_Int32 getLength() const
Returns the length of this string.
Definition: string.hxx:429
rtl_uString_newReplaceAllToAsciiL
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.
rtl::OUString::indexOf
sal_Int32 indexOf(const OUString &str, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified substring,...
Definition: ustring.hxx:2034
rtl::OUString::operator=
libreoffice_internal::ConstCharArrayDetector< T, OUString & >::Type operator=(T &literal)
Assign a new string from an 8-Bit string literal that is expected to contain only characters in the A...
Definition: ustring.hxx:494
rtl::OUString::replaceAll
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T1, typename libreoffice_internal::ConstCharArrayDetector< T2, OUString >::Type >::Type replaceAll(T1 &from, T2 &to) const
Returns a new string resulting from replacing all occurrences of a given substring with another subst...
Definition: ustring.hxx:2758
rtl_uString_newReplaceFirstUtf16LUtf16L
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.
rtl_uString_acquire
SAL_DLLPUBLIC void rtl_uString_acquire(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Increment the reference count of a string.
rtl::OUString::toBoolean
bool toBoolean() const
Returns the Boolean value from this string.
Definition: ustring.hxx:3065
rtl_uString_newFromAscii
SAL_DLLPUBLIC void rtl_uString_newFromAscii(rtl_uString **newStr, const sal_Char *value) SAL_THROW_EXTERN_C()
Allocate a new string that contains a copy of a character array.
sal_Unicode
sal_uInt16 sal_Unicode
Definition: types.h:137
rtl_ustr_asciil_reverseEquals_WithLength
SAL_DLLPUBLIC sal_Bool rtl_ustr_asciil_reverseEquals_WithLength(const sal_Unicode *first, const sal_Char *second, sal_Int32 len) SAL_THROW_EXTERN_C()
Compare two strings from back to front for equality.
rtl::OUString::boolean
static OUString boolean(bool b)
Returns the string representation of the boolean argument.
Definition: ustring.hxx:3511
rtl::OUString::intern
static OUString intern(const sal_Char *value, sal_Int32 length, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OSTRING_TO_OUSTRING_CVTFLAGS, sal_uInt32 *pInfo=NULL)
Return a canonical representation for a converted string.
Definition: ustring.hxx:3222
rtl::OUString::reverseCompareToAsciiL
sal_Int32 reverseCompareToAsciiL(const sal_Char *asciiStr, sal_Int32 asciiStrLength) const
Compares two strings in reverse order.
Definition: ustring.hxx:1127
rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths
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.
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
#define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
Definition: textcvt.h:64
rtl_uString_newReplaceAllFromIndex
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.
rtl_uString_newConcatAsciiL
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.
rtl_ustr_indexOfAscii_WithLength
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.
RTL_USTR_MAX_VALUEOFINT32
#define RTL_USTR_MAX_VALUEOFINT32
Definition: ustring.h:957
rtl::OUString::hashCode
sal_Int32 hashCode() const
Returns a hashcode for this string.
Definition: ustring.hxx:1964
rtl::OUString::equalsIgnoreAsciiCaseAscii
bool equalsIgnoreAsciiCaseAscii(const sal_Char *asciiStr) const
Perform an ASCII lowercase comparison of two strings.
Definition: ustring.hxx:1198
rtl::OUString::createFromAscii
static OUString createFromAscii(const sal_Char *value)
Returns an OUString copied without conversion from an ASCII character string.
Definition: ustring.hxx:3602
rtl_uString_newToAsciiLowerCase
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.
rtl::OUString::unacquired
static OUString const & unacquired(rtl_uString *const *ppHandle)
Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
Definition: ustring.hxx:450
rtl::OUString::replaceAt
SAL_WARN_UNUSED_RESULT OUString replaceAt(sal_Int32 index, sal_Int32 count, const OUString &newStr) const
Returns a new string resulting from replacing n = count characters from position index in this string...
Definition: ustring.hxx:2295
rtl::OUString::replaceAll
SAL_WARN_UNUSED_RESULT libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceAll(OUString const &from, T &to) const
Returns a new string resulting from replacing all occurrences of a given substring with another subst...
Definition: ustring.hxx:2732
rtl_ustr_toBoolean
SAL_DLLPUBLIC sal_Bool rtl_ustr_toBoolean(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a boolean.
salhelper::operator==
bool operator==(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:110
rtl::libreoffice_internal::ExceptConstCharArrayDetector::Type
Dummy Type
Definition: stringutils.hxx:279
rtl_uString_newConcatUtf16L
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.
rtl::OUString::OUString
OUString(const sal_Char *value, sal_Int32 length, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OSTRING_TO_OUSTRING_CVTFLAGS)
New string from an 8-Bit character buffer array.
Definition: ustring.hxx:355
rtl::OUString::fromUtf8
static OUString fromUtf8(const OString &rSource)
Convert an OString to an OUString, assuming that the OString is UTF-8-encoded.
Definition: ustring.hxx:3334
rtl::OUString::operator==
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(const OUString &rString, T &literal)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1770
rtl::OUString::operator==
friend libreoffice_internal::ConstCharArrayDetector< T, bool >::Type operator==(T &literal, const OUString &rString)
Compare string to an ASCII string literal.
Definition: ustring.hxx:1786
rtl::OUString::OUString
OUString(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
New string from an 8-Bit string literal that is expected to contain only characters in the ASCII set ...
Definition: ustring.hxx:253
rtl_uString_newReplaceFirstAsciiL
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.
rtl_ustr_valueOfDouble
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfDouble(sal_Unicode *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
rtl_uString_newReplaceAllAsciiLUtf16L
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.
rtl::operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, OString const &rString)
Support for rtl::OString in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO macros,...
Definition: string.hxx:1951
rtl_ustr_toFloat
SAL_DLLPUBLIC float rtl_ustr_toFloat(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Interpret a string as a float.
rtl::OUString::toUtf8
OString toUtf8() const
Convert this string to an OString, assuming that the string can be UTF-8-encoded successfully.
Definition: ustring.hxx:3357
rtl::OUString::OUString
OUString()
New string containing no characters.
Definition: ustring.hxx:136
rtl::OUString::OUString
OUString(sal_Unicode value)
New string from a single Unicode character.
Definition: ustring.hxx:195
rtl::OUString::replaceFirst
SAL_WARN_UNUSED_RESULT OUString replaceFirst(OUString const &from, OUString const &to, sal_Int32 *index=NULL) const
Returns a new string resulting from replacing the first occurrence of a given substring with another ...
Definition: ustring.hxx:2340
rtl_ustr_toInt64
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.
rtl::OUStringHash
A helper to use OUStrings with hash maps.
Definition: ustring.hxx:3686
rtl::OUString::operator=
OUString & operator=(const OUString &str)
Assign a new string.
Definition: ustring.hxx:458
rtl::OUString::match
bool match(const OUString &str, sal_Int32 fromIndex=0) const
Match against a substring appearing in this string.
Definition: ustring.hxx:934
rtl::OUStringHash::operator()
size_t operator()(const OUString &rString) const
Compute a hash code for a string.
Definition: ustring.hxx:3696
RTL_TEXTENCODING_UTF8
#define RTL_TEXTENCODING_UTF8
Definition: textenc.h:113
rtl::OUString::toInt32
sal_Int32 toInt32(sal_Int16 radix=10) const
Returns the int32 value from this string.
Definition: ustring.hxx:3091
rtl::OUString::endsWithIgnoreAsciiCase
bool endsWithIgnoreAsciiCase(OUString const &str, OUString *rest=NULL) const
Check whether this string ends with a given string, ignoring the case of ASCII letters.
Definition: ustring.hxx:1637
rtl::OUString::endsWithIgnoreAsciiCase
libreoffice_internal::ConstCharArrayDetector< T, bool >::Type endsWithIgnoreAsciiCase(T &literal, OUString *rest=NULL) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:1654
rtl_uString_internConvert
SAL_DLLPUBLIC void rtl_uString_internConvert(rtl_uString **newStr, const sal_Char *str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags, sal_uInt32 *pInfo) SAL_THROW_EXTERN_C()
Return a canonical representation for a string.
rtl::OUString::toUInt32
sal_uInt32 toUInt32(sal_Int16 radix=10) const
Returns the uint32 value from this string.
Definition: ustring.hxx:3108
rtl_ustr_valueOfInt32
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.
rtl::OUString::indexOf
libreoffice_internal::ConstCharArrayDetector< T, sal_Int32 >::Type indexOf(T &literal, sal_Int32 fromIndex=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:2047
rtl_uString_newTrim
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.
rtl::OUString::number
static OUString number(unsigned long i, sal_Int16 radix=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustring.hxx:3434
rtl::OUString::getToken
OUString getToken(sal_Int32 token, sal_Unicode cTok, sal_Int32 &index) const
Returns a token in the string.
Definition: ustring.hxx:3032
stringutils.hxx