52 #ifndef __PCL_String_h
53 #define __PCL_String_h
58 #include <pcl/Diagnostics.h>
74 #ifdef __PCL_ALIGNED_STRING_ALLOCATION
76 # define PCL_STRING_ALLOCATOR AlignedAllocator
79 # define PCL_STRING_ALLOCATOR StandardAllocator
82 #ifndef __PCL_NO_STRING_COMPLEX
86 #ifndef __PCL_NO_STRING_OSTREAM
88 # define _GLIBCXX_USE_WCHAR_T 1
93 #ifdef __PCL_QT_INTERFACE
94 # include <QtCore/QByteArray>
95 # include <QtCore/QDateTime>
96 # include <QtCore/QString>
97 # define PCL_GET_CHARPTR_FROM_QSTRING( qs ) (qs.toLatin1().data())
98 # define PCL_GET_CHAR16PTR_FROM_QSTRING( qs ) ((char16_type*)( qs.utf16() ))
99 # define PCL_GET_CHARPTR_FROM_QSTRINGVIEW( qv ) ((const char*)qv.data())
100 # define PCL_GET_CHAR16PTR_FROM_QSTRINGVIEW( qv ) ((const char16_type*)qv.data())
101 # define PCL_GET_QSTRING_FROM_CHAR16PTR( s ) (QString::fromUtf16( (const char16_t*)(s) ))
102 # define PCL_GET_CHARPTR_FROM_QBYTEARRAY( qb ) (qb.data())
103 # define PCL_QDATE_FMT_STR "yyyy/MM/dd"
104 # define PCL_QDATETIME_FMT_STR "yyyy/MM/dd hh:mm:ss"
110 #ifndef __PCL_NO_STRING_VECTOR
111 template <
typename T>
class PCL_CLASS GenericVector;
132 namespace RandomizationOption
136 Lowercase = 0x00000001,
137 Uppercase = 0x00000002,
138 Alpha = Lowercase|Uppercase,
140 Symbols = 0x00000008,
141 HexDigits = 0x00000010,
142 BinDigits = 0x00000020,
143 FullRange = 0x80000000,
144 Default = Alpha|Digits
217 unsigned precision_ = 2,
220 char separator_ =
':',
221 char padding_ =
' ' )
223 , precision( precision_ )
226 , separator( separator_ )
227 , padding( padding_ )
430 unsigned precision_ = 3,
431 bool timeZone_ =
true,
432 bool zuluTime_ =
true )
433 : timeItems( timeItems_ )
434 , precision( precision_ )
435 , timeZone( timeZone_ )
436 , zuluTime( zuluTime_ )
464 unsigned precision_ = 3 )
491 template <
class T,
class R,
class A = PCL_STRING_ALLOCATOR>
565 m_data = Data::New();
595 m_data = Data::New( len );
596 R::Copy( m_data->string, t, len );
599 m_data = Data::New();
624 m_data = Data::New( len );
625 R::Copy( m_data->string, i, len );
628 m_data = Data::New();
651 if ( i < len && (n =
pcl::Min( n, len-i )) > 0 )
653 m_data = Data::New( n );
654 R::Copy( m_data->string, t+i, n );
657 m_data = Data::New();
667 m_data = Data::New( n );
668 R::Fill( m_data->string, c, n );
671 m_data = Data::New();
680 if ( m_data !=
nullptr )
694 return m_data->IsUnique();
706 return m_data == s.m_data;
723 Data* newData = Data::New( len );
725 R::Copy( newData->string, m_data->string, len );
740 return R::BytesPerChar();
751 return Length()*BytesPerChar();
762 return m_data->end - m_data->string;
775 return m_data->capacity - m_data->string;
787 return m_data->capacity - m_data->end;
808 return m_data !=
nullptr;
820 return m_data->string == m_data->end;
846 PCL_PRECONDITION( !IsEmpty() )
857 return m_data->alloc;
889 PCL_PRECONDITION( i < Length() )
891 return m_data->string + i;
905 PCL_PRECONDITION( i < Length() )
906 return m_data->string + i;
950 return *m_data->string;
962 return *m_data->string;
979 return m_data->string;
992 return m_data->string;
1041 return (m_data->string < m_data->end) ? m_data->end-1 :
nullptr;
1056 return (m_data->string < m_data->end) ? m_data->end-1 :
nullptr;
1075 return (m_data->string < m_data->end) ? m_data->string-1 :
nullptr;
1090 return (m_data->string < m_data->end) ? m_data->string-1 :
nullptr;
1105 PCL_PRECONDITION( i >= m_data->string )
1106 return i - m_data->string;
1109 #ifndef __PCL_NO_STL_COMPATIBLE_ITERATORS
1152 static const char_type theNullChar = char_traits::Null();
1153 return IsEmpty() ? &theNullChar : Begin();
1272 MaybeReallocate( len );
1273 R::Copy( m_data->string, t, len );
1304 MaybeReallocate( len );
1305 R::Copy( m_data->string, i, len );
1317 void Assign( std::initializer_list<char_type> l )
1319 Assign( l.begin(), l.end() );
1338 if ( i < len && (n =
pcl::Min( n, len-i )) > 0 )
1340 MaybeReallocate( n );
1341 R::Copy( m_data->string, t+i, n );
1354 if ( !R::IsNull( c ) && n > 0 )
1356 MaybeReallocate( n );
1357 R::Fill( m_data->string, c, n );
1387 Data* newData = Data::New( len );
1391 R::Fill( m_data->string, c, len );
1417 else if ( !IsUnique() )
1419 Data* newData = Data::New( len );
1423 R::Fill( m_data->string+i, c, n );
1450 volatile char* s =
reinterpret_cast<volatile char*
>( m_data->string );
1467 if ( Capacity() < n+1 )
1471 m_data->Reserve( len, n );
1472 if ( old !=
nullptr )
1475 R::Copy( m_data->string, old, len );
1476 m_data->alloc.Deallocate( old );
1483 Data* newData = Data::New();
1484 newData->Reserve( len,
pcl::Max( len, n ) );
1486 R::Copy( newData->string, m_data->string, len );
1507 if ( n != Length() )
1511 if ( !IsUnique() || m_data->ShouldReallocate( n ) )
1513 Data* newData = Data::New( n );
1516 R::Copy( newData->string, m_data->string,
pcl::Min( n, m ) );
1521 m_data->SetLength( n );
1553 SetLength( R::Length( m_data->string ) );
1581 if ( Available() > 0 )
1589 m_data->Allocate( len, 0 );
1590 R::Copy( m_data->string, old, len );
1591 m_data->alloc.Deallocate( old );
1595 Data* newData = Data::New( len, 0 );
1596 R::Copy( newData->string, m_data->string, len );
1656 if ( dst !=
nullptr )
1657 if ( maxCharsToCopy > 0 )
1659 if ( --maxCharsToCopy > 0 )
1665 R::Copy( dst, m_data->string+i, n );
1677 template <
class R1,
class A1>
1683 UninitializedGrow( i, n );
1684 R::Copy( m_data->string+i, s.m_data->string, n );
1700 UninitializedGrow( i, n );
1701 R::Copy( m_data->string+i, p, n );
1714 UninitializedGrow( i, n );
1715 R::Copy( m_data->string+i, t, n );
1725 if ( (n =
pcl::Min( n, R::Length( t ) )) > 0 )
1727 UninitializedGrow( i, n );
1728 R::Copy( m_data->string+i, t, n );
1739 UninitializedGrow( i, n );
1740 R::Fill( m_data->string+i, c, n );
1747 template <
class R1,
class A1>
1750 Insert( maxPos, s );
1757 template <
class R1,
class A1>
1773 Insert( maxPos, i, j );
1782 Insert( maxPos, t, n );
1790 Insert( maxPos, t );
1808 Insert( maxPos, c, n );
1815 template <
class R1,
class A1>
1871 template <
class R1,
class A1>
1881 template <
class R1,
class A1>
1950 template <
class R1,
class A1>
1965 UninitializedGrow( i, ns-n );
1971 R::Copy( m_data->string+i, s.m_data->string, ns );
2004 UninitializedGrow( i, nt-n );
2010 R::Copy( m_data->string+i, t, nt );
2038 UninitializedGrow( i, nc-n );
2044 R::Fill( m_data->string+i, c, nc );
2062 ReplaceChar( c1, c2, i, n,
true );
2074 ReplaceChar( c1, c2, i, n,
false );
2082 template <
class R1,
class A1,
class R2,
class A2>
2086 ReplaceString( s1.m_data->string, s1.
Length(), s2.m_data->string, s2.
Length(), i,
true );
2096 ReplaceString( t1, R::Length( t1 ), t2, R::Length( t2 ), i,
true );
2106 template <
class R1,
class A1,
class R2,
class A2>
2110 ReplaceString( s1.m_data->string, s1.
Length(), s2.m_data->string, s2.
Length(), i,
false );
2122 ReplaceString( t1, R::Length( t1 ), t2, R::Length( t2 ), i,
false );
2140 if ( !IsUnique() || m_data->ShouldReallocate( newLen ) )
2142 Data* newData = Data::New( newLen );
2144 R::Copy( newData->string, m_data->string, i );
2146 R::Copy( newData->string+i, m_data->string+i+n, newLen-i );
2153 R::CopyOverlapped( m_data->string+i, m_data->string+i+n, newLen-i );
2154 m_data->SetLength( newLen );
2169 Delete( i, maxPos );
2188 ReplaceString( &c, 1,
nullptr, 0, i,
true );
2200 ReplaceString( &c, 1,
nullptr, 0, i,
false );
2208 template <
class R1,
class A1>
2211 ReplaceString( s.m_data->string, s.
Length(),
nullptr, 0, i,
true );
2221 ReplaceString( t, R::Length( t ),
nullptr, 0, i,
true );
2231 template <
class R1,
class A1>
2234 ReplaceString( s.m_data->string, s.
Length(),
nullptr, 0, i,
false );
2246 ReplaceString( t, R::Length( t ),
nullptr, 0, i,
false );
2262 m_data->Deallocate();
2265 Data* newData = Data::New();
2286 t.m_data->Allocate( n );
2287 R::Copy( t.m_data->string, m_data->string+i, n );
2309 t.m_data->Allocate( n );
2310 R::Copy( t.m_data->string, m_data->string, n );
2331 t.m_data->Allocate( n );
2332 R::Copy( t.m_data->string, m_data->string+len-n, n );
2348 return Substring( i );
2359 return Left( (i > 0) ? i-1 : 0 );
2379 template <
class C,
class R1,
class A1>
2388 for ( SearchEngine S( s.m_data->string, n,
true ); ; )
2390 size_type j = S( m_data->string, i, len );
2400 l = R::SearchTrimLeft( l, r );
2401 m = R::SearchTrimRight( l, r ) - l;
2405 t.m_data->Allocate( m );
2406 R::Copy( t.m_data->string, l, m );
2448 for ( SearchEngine S( s, n,
true ); ; )
2450 size_type j = S( m_data->string, i, len );
2460 l = R::SearchTrimLeft( l, r );
2461 m = R::SearchTrimRight( l, r ) - l;
2465 t.m_data->Allocate( m );
2466 R::Copy( t.m_data->string, l, m );
2521 l = R::SearchTrimLeft( l, r );
2522 m = R::SearchTrimRight( l, r ) - l;
2526 t.m_data->Allocate( m );
2527 R::Copy( t.m_data->string, l, m );
2564 template <
class C,
typename S>
2589 l = R::SearchTrimLeft( l, r );
2590 m = R::SearchTrimRight( l, r ) - l;
2594 t.m_data->Allocate( m );
2595 R::Copy( t.m_data->string, l, m );
2631 template <
class C,
class R1,
class A1>
2641 for ( SearchEngine S( s.m_data->string, n,
false ); ; )
2643 size_type j = S( m_data->string, i, len );
2653 l = R::SearchTrimLeft( l, r );
2654 m = R::SearchTrimRight( l, r ) - l;
2658 t.m_data->Allocate( m );
2659 R::Copy( t.m_data->string, l, m );
2707 for ( SearchEngine S( s, n,
false ); ; )
2709 size_type j = S( m_data->string, i, len );
2719 l = R::SearchTrimLeft( l, r );
2720 m = R::SearchTrimRight( l, r ) - l;
2724 t.m_data->Allocate( m );
2725 R::Copy( t.m_data->string, l, m );
2769 c = R::ToCaseFolded( c );
2774 if ( R::ToCaseFolded( *p ) == c )
2785 l = R::SearchTrimLeft( l, r );
2786 m = R::SearchTrimRight( l, r ) - l;
2790 t.m_data->Allocate( m );
2791 R::Copy( t.m_data->string, l, m );
2812 return (m_data->string !=
nullptr) ? *m_data->string : R::Null();
2821 return (m_data->string < m_data->end) ? *(m_data->end-1) : R::Null();
2827 template <
class R1,
class A1>
2830 if ( s.IsEmpty() || Length() < s.Length() )
2832 for (
const_iterator p = m_data->string, q = s.m_data->string; q < s.m_data->end; ++p, ++q )
2845 if ( n == 0 || Length() < n )
2847 for (
const_iterator p = m_data->string, e = p+n; p < e; ++p, ++t )
2858 return m_data->string < m_data->end && *m_data->string == c;
2865 template <
class R1,
class A1>
2868 if ( s.IsEmpty() || Length() < s.Length() )
2870 for (
const_iterator p = m_data->string, q = s.m_data->string; q < s.m_data->end; ++p, ++q )
2871 if ( R::ToCaseFolded( *p ) != R::ToCaseFolded( *q ) )
2883 if ( n == 0 || Length() < n )
2885 for (
const_iterator p = m_data->string, e = p+n; p < e; ++p, ++t )
2886 if ( R::ToCaseFolded( *p ) != R::ToCaseFolded( *t ) )
2897 return m_data->string < m_data->end && R::ToCaseFolded( *m_data->string ) == R::ToCaseFolded( c );
2903 template <
class R1,
class A1>
2907 if ( n == 0 || Length() < n )
2909 for (
const_iterator p = m_data->end-n, q = s.m_data->string; p < m_data->end; ++p, ++q )
2922 if ( n == 0 || Length() < n )
2924 for (
const_iterator p = m_data->end-n; p < m_data->end; ++p, ++t )
2935 return m_data->string < m_data->end && *(m_data->end-1) == c;
2942 template <
class R1,
class A1>
2946 if ( n == 0 || Length() < n )
2948 for (
const_iterator p = m_data->end-n, q = s.m_data->string; p < m_data->end; ++p, ++q )
2949 if ( R::ToCaseFolded( *p ) != R::ToCaseFolded( *q ) )
2961 if ( n == 0 || Length() < n )
2963 for (
const_iterator p = m_data->end-n; p < m_data->end; ++p, ++t )
2964 if ( R::ToCaseFolded( *p ) != R::ToCaseFolded( *t ) )
2975 return m_data->string < m_data->end && R::ToCaseFolded( *(m_data->end-1) ) == R::ToCaseFolded( c );
2983 template <
class R1,
class A1>
2987 i = SearchEngine( s.m_data->string, s.
Length(),
true )( m_data->string, i, len );
2988 return (i < len) ? i : notFound;
2999 i = SearchEngine( t, R::Length( t ),
true )( m_data->string, i, len );
3000 return (i < len) ? i : notFound;
3010 for (
const_iterator p = m_data->string+i; p < m_data->end; ++p )
3012 return p - m_data->string;
3024 template <
class R1,
class A1>
3028 i = SearchEngine( s.m_data->string, s.
Length(),
false )( m_data->string, i, len );
3029 return (i < len) ? i : notFound;
3043 i = SearchEngine( t, R::Length( t ),
false )( m_data->string, i, len );
3044 return (i < len) ? i : notFound;
3057 c = R::ToCaseFolded( c );
3058 for (
const_iterator p = m_data->string+i; p < m_data->end; ++p )
3059 if ( R::ToCaseFolded( *p ) == c )
3060 return p - m_data->string;
3067 template <
class R1,
class A1>
3070 return FindFirst( s, i );
3078 return FindFirst( t, i );
3086 return FindFirst( c, i );
3092 template <
class R1,
class A1>
3095 return FindFirstIC( s, i );
3103 return FindFirstIC( t, i );
3111 return FindFirstIC( c, i );
3123 template <
class R1,
class A1>
3127 size_type i = SearchEngine( s.m_data->string, s.Length(),
true,
true )( m_data->string, 0, r );
3128 return (i < r) ? i : notFound;
3143 size_type i = SearchEngine( t, R::Length( t ),
true,
true )( m_data->string, 0, r );
3144 return (i < r) ? i : notFound;
3173 template <
class R1,
class A1>
3177 size_type i = SearchEngine( s.m_data->string, s.Length(),
false,
true )( m_data->string, 0, r );
3178 return (i < r) ? i : notFound;
3196 size_type i = SearchEngine( t, R::Length( t ),
false,
true )( m_data->string, 0, r );
3197 return (i < r) ? i : notFound;
3210 c = R::ToCaseFolded( c );
3213 if ( R::ToCaseFolded( *--p ) == c )
3221 template <
class R1,
class A1>
3224 return Find( s ) != notFound;
3232 return Find( t ) != notFound;
3240 return Find( c ) != notFound;
3249 template <
class R1,
class A1>
3252 return FindIC( s ) != notFound;
3263 return FindIC( t ) != notFound;
3274 return FindIC( c ) != notFound;
3288 const_iterator l = R::SearchTrimLeft( m_data->string, m_data->end );
3290 if ( m_data->string < l || r < m_data->end )
3305 const_iterator l = R::SearchTrimLeft( m_data->string, m_data->end );
3306 if ( m_data->string < l )
3307 Trim( l, m_data->end - l );
3321 const_iterator r = R::SearchTrimRight( m_data->string, m_data->end );
3322 if ( r < m_data->end )
3323 Trim( m_data->string, r - m_data->string );
3370 int encloseLeft = 1;
3371 int encloseRight = 1;
3375 if ( *m_data->string == c )
3377 if ( *(m_data->end-1) == c )
3383 size_type n = len + encloseLeft + encloseRight;
3386 if ( !IsUnique() || m_data->ShouldReallocate( n ) )
3388 Data* newData = Data::New( n );
3389 R::Copy( newData->string + encloseLeft, m_data->string, len );
3395 m_data->SetLength( n );
3396 R::CopyOverlapped( m_data->string + encloseLeft, m_data->string, len );
3400 *m_data->string = c;
3402 *(m_data->end-1) = c;
3427 EnsureEnclosed( R::SingleQuote() );
3451 EnsureEnclosed( R::DoubleQuote() );
3484 if ( *m_data->string == R::SingleQuote() && *(m_data->end-1) == R::SingleQuote() ||
3485 *m_data->string == R::DoubleQuote() && *(m_data->end-1) == R::DoubleQuote() )
3488 R::CopyOverlapped( m_data->string, m_data->string+1, len-2 );
3489 m_data->SetLength( len-2 );
3493 Data* newData = Data::New( len-2 );
3494 R::Copy( newData->string, m_data->string+1, len-2 );
3526 Append( fill, width-len );
3544 Prepend( fill, width-len );
3566 Prepend( fill, n2 );
3567 Append( fill, n-n2 );
3633 template <
class R1,
class A1>
3636 return R::CompareCodePoints( m_data->string, Length(), s.m_data->string, s.
Length(), caseSensitive );
3665 return R::CompareCodePoints( m_data->string, Length(), t, R::Length( t ), caseSensitive );
3697 return R::CompareCodePoints( m_data->string, Length(), &c, 1, caseSensitive );
3726 template <
class R1,
class A1>
3728 bool caseSensitive =
true,
bool localeAware =
true ) const noexcept
3730 return R::Compare( m_data->string, Length(), s.m_data->string, s.
Length(), caseSensitive, localeAware );
3762 return R::Compare( m_data->string, Length(), t, R::Length( t ), caseSensitive, localeAware );
3796 return R::Compare( m_data->string, Length(), &c, 1, caseSensitive, localeAware );
3819 template <
class R1,
class A1>
3822 return R::Compare( m_data->string, Length(), s.m_data->string, s.
Length(),
false, localeAware );
3848 return R::Compare( m_data->string, Length(), t, R::Length( t ),
false, localeAware );
3877 return R::Compare( m_data->string, Length(), &c, 1,
false, localeAware );
3895 template <
class R1,
class A1>
3898 return R::WildMatch( m_data->string, Length(), pattern.m_data->string, pattern.
Length(), caseSensitive );
3914 template <
class R1,
class A1>
3917 return R::WildMatch( m_data->string, Length(), pattern.m_data->string, pattern.Length(),
false );
3937 return R::WildMatch( m_data->string, Length(), pattern, R::Length( pattern ), caseSensitive );
3956 return R::WildMatch( m_data->string, Length(), pattern, R::Length( pattern ),
false );
3965 for (
iterator i = m_data->string; i < m_data->end; ++i )
3966 if ( R::IsWildcard( *i ) )
3981 R::ToCaseFolded( m_data->string, len );
3995 R::ToLowercase( m_data->string, len );
4009 R::ToUppercase( m_data->string, len );
4056 for (
iterator i = m_data->string, j = m_data->end; i < --j; ++i )
4079 pcl::Sort( m_data->string, m_data->end );
4105 pcl::Sort( m_data->string, m_data->end, p );
4139 char_type c = *R::SearchTrimLeft( m_data->string, m_data->end );
4140 return R::IsDigit( c ) || R::IsSign( c ) || R::IsDecimalSeparator( c );
4161 char_type c = *R::SearchTrimLeft( m_data->string, m_data->end );
4162 return R::IsSymbolDigit( c );
4188 if ( R::IsStartingSymbolDigit( *i ) )
4191 if ( ++i == m_data->end )
4193 if ( !R::IsSymbolDigit( *i ) )
4196 pos = i - m_data->string;
4214 if ( R::IsStartingSymbolDigit( *m_data->string ) )
4217 if ( !R::IsSymbolDigit( *i ) )
4234 return pcl::Hash64( m_data->string, Size(), seed );
4247 return pcl::Hash32( m_data->string, Size(), seed );
4268 return Data::DeleteFreeList();
4279 void DetachFromData()
4281 if ( !m_data->Detach() )
4282 Data::Dispose( m_data );
4300 if ( m_data->ShouldReallocate( len ) )
4302 m_data->Deallocate();
4303 m_data->Allocate( len );
4306 m_data->SetLength( len );
4310 Data* newData = Data::New( len );
4334 if (
size_type( m_data->capacity - m_data->string ) < newLen+1 )
4336 iterator old = m_data->string;
4337 m_data->Allocate( newLen );
4338 if ( old !=
nullptr )
4341 R::Copy( m_data->string, old, i );
4343 R::Copy( m_data->string+i+n, old+i, len-i );
4344 m_data->alloc.Deallocate( old );
4350 R::CopyOverlapped( m_data->string+i+n, m_data->string+i, len-i );
4351 m_data->SetLength( newLen );
4356 Data* newData = Data::New( newLen );
4358 R::Copy( newData->string, m_data->string, i );
4360 R::Copy( newData->string+i+n, m_data->string+i, len-i );
4371 void Trim( const_iterator left,
size_type len )
4377 if ( m_data->ShouldReallocate( len ) )
4379 iterator old = m_data->string;
4380 m_data->Allocate( len );
4381 R::Copy( m_data->string, left, len );
4382 if ( old !=
nullptr )
4383 m_data->alloc.Deallocate( old );
4387 if ( left != m_data->string )
4388 R::CopyOverlapped( m_data->string, left, len );
4389 m_data->SetLength( len );
4394 Data* newData = Data::New( len );
4395 R::Copy( newData->string, left, len );
4408 void ReplaceChar( char_type c1, char_type c2,
size_type i,
size_type n,
bool caseSensitive )
4416 if ( caseSensitive )
4418 for ( iterator p = m_data->string + i, p1 = p + n; p < p1; ++p )
4423 p = m_data->string + d;
4425 for ( iterator p1 = m_data->string + i + n; ++p < p1; )
4433 c1 = R::ToCaseFolded( c1 );
4434 for ( iterator p = m_data->string + i, p1 = p + n; p < p1; ++p )
4435 if ( R::ToCaseFolded( *p ) == c1 )
4439 p = m_data->string + d;
4441 for ( iterator p1 = m_data->string + i + n; ++p < p1; )
4442 if ( R::ToCaseFolded( *p ) == c1 )
4462 SearchEngine S( t1, n1, caseSensitive );
4466 for (
size_type p = i; (p = S( m_data->string, p, len )) < len; p += n1 )
4467 R::Copy( m_data->string + p, t2, n2 );
4472 for (
size_type p = i; (p = S( m_data->string, p, len )) < len; p += n1 )
4478 newLen += P.Length()*(n2 - n1);
4480 newLen -= P.Length()*(n1 - n2);
4484 Data* newData = Data::New( newLen );
4491 R::Copy( newData->string+targetIndex, m_data->string+sourceIndex, n );
4492 R::Copy( newData->string+targetIndex+n, t2, n2 );
4493 targetIndex += n + n2;
4494 sourceIndex = p + n1;
4496 if ( sourceIndex < len )
4497 R::Copy( newData->string+targetIndex, m_data->string+sourceIndex, len-sourceIndex );
4526 class PCL_CLASS SearchEngine
4540 SearchEngine( const_iterator pattern,
size_type patternLength,
4541 bool caseSensitive =
true,
bool searchLast =
false,
bool useBoyerMoore =
true )
4542 : m_pattern( pattern )
4543 , m_patternLength( int( patternLength ) )
4544 , m_caseSensitive( caseSensitive )
4545 , m_searchLast( searchLast )
4546 , m_useBoyerMoore( useBoyerMoore && m_patternLength > 3 )
4548 if ( m_useBoyerMoore )
4566 if ( endIndex <= startIndex
4567 || m_patternLength <= 0
4568 || endIndex-startIndex <
size_type( m_patternLength )
4570 || m_pattern ==
nullptr )
4573 if ( m_caseSensitive )
4575 if ( m_useBoyerMoore )
4579 for (
size_type i = startIndex, r = endIndex-m_patternLength; i <= r; )
4582 const_iterator t = text + r - i;
4583 const_iterator p = m_pattern;
4584 for (
int j = m_patternLength; --j >= 0; )
4589 skip = j - m_skipList[
uint8( c )];
4602 for (
size_type i = startIndex, r = endIndex-m_patternLength; i <= r; )
4605 const_iterator t = text + i + m_patternLength;
4606 const_iterator p = m_pattern + m_patternLength;
4607 for (
int j = m_patternLength; --j >= 0; )
4613 skip = j - m_skipList[
uint8( c )];
4630 for (
size_type i = endIndex-m_patternLength; ; --i )
4632 const_iterator t = text + i;
4633 const_iterator p = m_pattern;
4634 for (
int j = m_patternLength; ; ++t, ++p )
4641 if ( i == startIndex )
4647 for (
size_type i = startIndex, r = endIndex-m_patternLength; ; ++i )
4649 const_iterator t = text + i;
4650 const_iterator p = m_pattern;
4651 for (
int j = m_patternLength; ; ++t, ++p )
4666 if ( m_useBoyerMoore )
4670 for (
size_type i = startIndex, r = endIndex-m_patternLength; i <= r; )
4673 const_iterator t = text + r - i;
4674 const_iterator p = m_pattern;
4675 for (
int j = m_patternLength; --j >= 0; )
4677 char_type c = R::ToCaseFolded( *t++ );
4678 if ( c != R::ToCaseFolded( *p++ ) )
4680 skip = j - m_skipList[
uint8( c )];
4693 for (
size_type i = startIndex, r = endIndex-m_patternLength; i <= r; )
4696 const_iterator t = text + i + m_patternLength;
4697 const_iterator p = m_pattern + m_patternLength;
4698 for (
int j = m_patternLength; --j >= 0; )
4700 char_type c = R::ToCaseFolded( *--t );
4701 if ( c != R::ToCaseFolded( *--p ) )
4704 skip = j - m_skipList[
uint8( c )];
4721 for (
size_type i = endIndex-m_patternLength; ; --i )
4723 const_iterator t = text + i;
4724 const_iterator p = m_pattern;
4725 for (
int j = m_patternLength; ; ++t, ++p )
4727 if ( R::ToCaseFolded( *t ) != R::ToCaseFolded( *p ) )
4732 if ( i == startIndex )
4738 for (
size_type i = startIndex, r = endIndex-m_patternLength; ; ++i )
4740 const_iterator t = text + i;
4741 const_iterator p = m_pattern;
4742 for (
int j = m_patternLength; ; ++t, ++p )
4744 if ( R::ToCaseFolded( *t ) != R::ToCaseFolded( *p ) )
4760 int m_skipList[ 256 ];
4761 const_iterator m_pattern;
4762 int m_patternLength;
4763 bool m_caseSensitive : 1;
4764 bool m_searchLast : 1;
4765 bool m_useBoyerMoore : 1;
4767 void InitSkipList() noexcept
4769 ::memset( m_skipList, 0xff,
sizeof( m_skipList ) );
4772 const_iterator p = m_pattern + m_patternLength;
4773 if ( m_caseSensitive )
4774 for (
int i = 0; i < m_patternLength; ++i )
4775 m_skipList[
uint8( *--p )] = i;
4777 for (
int i = 0; i < m_patternLength; ++i )
4778 m_skipList[
uint8( R::ToCaseFolded( *--p ) )] = i;
4782 const_iterator p = m_pattern;
4783 if ( m_caseSensitive )
4784 for (
int i = 0; i < m_patternLength; ++i )
4785 m_skipList[
uint8( *p++ )] = i;
4787 for (
int i = 0; i < m_patternLength; ++i )
4788 m_skipList[
uint8( R::ToCaseFolded( *p++ ) )] = i;
4800 class PCL_CLASS Data :
public ReferenceCounter
4804 #ifndef __PCL_NO_STRING_FREE_LIST
4805 static Data* freeList;
4806 static AtomicInt freeLock;
4811 iterator
string =
nullptr;
4812 iterator end =
nullptr;
4813 iterator capacity =
nullptr;
4835 Allocate( len, total );
4858 total = (len <= total) ? alloc.PagedLength( total+1 ) : len+1;
4859 string = alloc.Allocate( total );
4860 capacity =
string + total;
4870 Allocate( len, len );
4883 PCL_PRECONDITION( len <= total )
4884 string = alloc.Allocate( total+1 );
4885 capacity =
string + total+1;
4886 SetLength(
pcl::Min( len, total ) );
4894 PCL_CHECK( (
string ==
nullptr) ? end ==
nullptr :
string < end )
4895 if (
string !=
nullptr )
4897 alloc.Deallocate(
string );
4906 bool ShouldReallocate(
size_type len )
const noexcept
4909 return m <= len || alloc.ReallocatedLength( m, len+1 ) < (m >> 1);
4916 void SetLength(
size_type len ) noexcept
4918 *(end = (
string + len)) = R::Null();
4924 void Reset() noexcept
4926 string = end = capacity =
nullptr;
4935 #ifndef __PCL_NO_STRING_FREE_LIST
4936 static Data* NextFree() noexcept
4938 if ( freeLock.TestAndSet( 0, 1 ) )
4940 Data* data = freeList;
4941 if ( data !=
nullptr )
4942 freeList =
reinterpret_cast<Data*
>( data->string );
4943 freeLock.Store( 0 );
4959 #ifndef __PCL_NO_STRING_FREE_LIST
4960 Data* data = NextFree();
4961 if ( data !=
nullptr )
4963 data->string =
nullptr;
4979 #ifndef __PCL_NO_STRING_FREE_LIST
4980 Data* data = NextFree();
4981 if ( data !=
nullptr )
4983 data->Allocate( len );
4987 return new Data( len );
4999 #ifndef __PCL_NO_STRING_FREE_LIST
5000 Data* data = NextFree();
5001 if ( data !=
nullptr )
5003 data->Allocate( len, total );
5007 return new Data( len, total );
5017 static void Dispose( Data* data )
5019 PCL_PRECONDITION( data !=
nullptr )
5020 PCL_CHECK( data->RefCount() == 0 )
5021 #ifndef __PCL_NO_STRING_FREE_LIST
5022 if ( freeLock.TestAndSet( 0, 1 ) )
5026 data->string =
reinterpret_cast<iterator
>( freeList );
5028 freeLock.Store( 0 );
5045 #ifndef __PCL_NO_STRING_FREE_LIST
5046 while ( freeList !=
nullptr )
5048 Data* data = freeList;
5049 freeList =
reinterpret_cast<Data*
>( data->string );
5050 data->string =
nullptr;
5062 Data* m_data =
nullptr;
5065 #ifndef __PCL_NO_STRING_FREE_LIST
5067 template <
class T,
class R,
class A>
5068 typename GenericString<T,R,A>::Data* GenericString<T,R,A>::Data::freeList =
nullptr;
5070 template <
class T,
class R,
class A>
5071 AtomicInt GenericString<T,R,A>::Data::freeLock;
5078 template <
class T,
class R,
class A>
inline
5096 template <
class T,
class R1,
class A1,
class R2,
class A2>
inline
5099 return s1.CompareCodePoints( s2 ) == 0;
5109 template <
class T,
class R1,
class A1,
class R2,
class A2>
inline
5112 return s1.CompareCodePoints( s2 ) < 0;
5122 template <
class T,
class R1,
class A1,
class R2,
class A2>
inline
5125 return s1.CompareCodePoints( s2 ) <= 0;
5135 template <
class T,
class R1,
class A1,
class R2,
class A2>
inline
5138 return s1.CompareCodePoints( s2 ) > 0;
5148 template <
class T,
class R1,
class A1,
class R2,
class A2>
inline
5151 return s1.CompareCodePoints( s2 ) >= 0;
5160 template <
class T,
class R,
class A>
inline
5163 return s1.CompareCodePoints( t2 ) == 0;
5173 template <
class T,
class R,
class A>
inline
5176 return s1.CompareCodePoints( t2 ) < 0;
5186 template <
class T,
class R,
class A>
inline
5189 return s1.CompareCodePoints( t2 ) <= 0;
5199 template <
class T,
class R,
class A>
inline
5202 return s1.CompareCodePoints( t2 ) > 0;
5212 template <
class T,
class R,
class A>
inline
5215 return s1.CompareCodePoints( t2 ) >= 0;
5224 template <
class T,
class R,
class A>
inline
5227 return s2.CompareCodePoints( t1 ) == 0;
5237 template <
class T,
class R,
class A>
inline
5240 return s2.CompareCodePoints( t1 ) > 0;
5250 template <
class T,
class R,
class A>
inline
5253 return s2.CompareCodePoints( t1 ) >= 0;
5263 template <
class T,
class R,
class A>
inline
5266 return s2.CompareCodePoints( t1 ) < 0;
5276 template <
class T,
class R,
class A>
inline
5279 return s2.CompareCodePoints( t1 ) <= 0;
5288 template <
class T,
class R,
class A>
inline
5291 return s1.CompareCodePoints( c2 ) == 0;
5301 template <
class T,
class R,
class A>
inline
5304 return s1.CompareCodePoints( c2 ) < 0;
5314 template <
class T,
class R,
class A>
inline
5317 return s1.CompareCodePoints( c2 ) <= 0;
5327 template <
class T,
class R,
class A>
inline
5330 return s1.CompareCodePoints( c2 ) > 0;
5340 template <
class T,
class R,
class A>
inline
5343 return s1.CompareCodePoints( c2 ) >= 0;
5352 template <
class T,
class R,
class A>
inline
5355 return s2.CompareCodePoints( c1 ) == 0;
5365 template <
class T,
class R,
class A>
inline
5368 return s2.CompareCodePoints( c1 ) > 0;
5378 template <
class T,
class R,
class A>
inline
5381 return s2.CompareCodePoints( c1 ) >= 0;
5391 template <
class T,
class R,
class A>
inline
5394 return s2.CompareCodePoints( c1 ) < 0;
5404 template <
class T,
class R,
class A>
inline
5407 return s2.CompareCodePoints( c1 ) <= 0;
5565 (void)
operator =( s );
5627 (void)
operator =( t );
5671 (void)Format(
"%hd", x );
5681 (void)Format(
"%hu", x );
5691 (void)Format(
"%i", x );
5701 (void)Format(
"%u", x );
5711 (void)Format(
"%ld", x );
5721 (void)Format(
"%lu", x );
5731 (void)Format(
"%lli", x );
5741 (void)Format(
"%llu", x );
5751 (void)Format(
"%.7g", x );
5761 (void)Format(
"%.16g", x );
5772 (void)Format(
"%.16Lg", x );
5774 (void)Format(
"%.18Lg", x );
5778 #ifndef __PCL_NO_STRING_COMPLEX
5787 (void)Format(
"{%.7g,%.7g}", x.
Real(), x.
Imag() );
5797 (void)Format(
"{%.16g,%.16g}", x.
Real(), x.
Imag() );
5808 (void)Format(
"{%.16Lg,%.16Lg}", x.
Real(), x.
Imag() );
5810 (void)Format(
"{%.18Lg,%.18Lg}", x.
Real(), x.
Imag() );
5816 #ifdef __PCL_QT_INTERFACE
5820 : string_base( qs.isEmpty() ? iterator( nullptr ) : iterator( PCL_GET_CHARPTR_FROM_QSTRING( qs ) ) )
5825 IsoString(
const QAnyStringView& qv )
5826 : string_base( qv.isEmpty() ? iterator( nullptr ) : iterator( PCL_GET_CHARPTR_FROM_QSTRINGVIEW( qv ) ) )
5831 IsoString(
const QByteArray& qb )
5832 : string_base( qb.isEmpty() ? iterator( nullptr ) : iterator( PCL_GET_CHARPTR_FROM_QBYTEARRAY( qb ) ) )
5837 IsoString(
const QDate& qd )
5838 : string_base( iterator( PCL_GET_CHARPTR_FROM_QSTRING( qd.toString( PCL_QDATE_FMT_STR ) ) ) )
5843 IsoString(
const QDateTime& qdt )
5844 : string_base( iterator( PCL_GET_CHARPTR_FROM_QSTRING( qdt.toString( PCL_QDATETIME_FMT_STR ) ) ) )
5902 return operator =( s.
Begin() );
5935 IsoString& operator =( const_c_ustring t );
5937 #ifdef __PCL_QT_INTERFACE
5939 IsoString& operator =(
const QString& qs )
5944 Assign( PCL_GET_CHARPTR_FROM_QSTRING( qs ) );
5948 IsoString& operator =(
const QByteArray& qb )
5953 Assign( PCL_GET_CHARPTR_FROM_QBYTEARRAY( qb ) );
5957 IsoString& operator =(
const QDate& qd )
5959 Assign( PCL_GET_CHARPTR_FROM_QSTRING( qd.toString( PCL_QDATE_FMT_STR ) ) );
5963 IsoString& operator =(
const QDateTime& qdt )
5965 Assign( PCL_GET_CHARPTR_FROM_QSTRING( qdt.toString( PCL_QDATETIME_FMT_STR ) ) );
5973 IsoString SetToLength(
size_type n )
const
5975 return string_base::SetToLength( n );
5978 IsoString ResizedToNullTerminated()
const
5980 return string_base::ResizedToNullTerminated();
5983 IsoString Squeezed()
const
5985 return string_base::Squeezed();
5992 return string_base::Substring( i, n );
5997 return string_base::Left( n );
6002 return string_base::Right( n );
6007 return string_base::Suffix( i );
6012 return string_base::Prefix( i );
6017 IsoString Trimmed()
const
6019 return string_base::Trimmed();
6022 IsoString TrimmedLeft()
const
6024 return string_base::TrimmedLeft();
6027 IsoString TrimmedRight()
const
6029 return string_base::TrimmedRight();
6036 return string_base::LeftJustified( width, fill );
6041 return string_base::RightJustified( width, fill );
6046 return string_base::CenterJustified( width, fill );
6051 IsoString Enclosed( char_type c )
const
6053 return string_base::Enclosed( c );
6056 IsoString SingleQuoted()
const
6058 return string_base::SingleQuoted();
6061 IsoString DoubleQuoted()
const
6063 return string_base::DoubleQuoted();
6066 IsoString Unquoted()
const
6068 return string_base::Unquoted();
6073 IsoString CaseFolded()
const
6075 return string_base::CaseFolded();
6078 IsoString Lowercase()
const
6080 return string_base::Lowercase();
6083 IsoString Uppercase()
const
6085 return string_base::Uppercase();
6090 IsoString Reversed()
const
6092 return string_base::Reversed();
6095 IsoString Sorted()
const
6097 return string_base::Sorted();
6101 IsoString Sorted( BP p )
const
6103 return string_base::Sorted( p );
6121 return c.ToSeparated( *
this, separator );
6140 template <
class C,
class AF>
6144 return c.ToSeparated( *
this, separator, append );
6160 return c.ToSeparated( *
this, separator );
6179 template <
class C,
class AF>
6183 return c.ToSeparated( *
this, separator, append );
6198 return ToSeparated( c,
IsoString( separator ) );
6217 template <
class C,
class AF>
6220 return ToSeparated( c,
IsoString( separator ), append );
6414 return ToURLEncoded( c.Begin(), c.Length()*
sizeof( *c.Begin() ) );
6462 return FromURLEncoded( c.Begin(), c.Length()*
sizeof( *c.Begin() ) );
6478 return FromURLEncoded( Begin(), Length() );
6503 return ToURLDecoded( c.Begin(), c.Length()*
sizeof( *c.Begin() ) );
6530 #ifdef __PCL_QT_INTERFACE
6532 operator QString()
const
6534 return QString( c_str() );
6537 operator QAnyStringView()
const
6539 return QAnyStringView( c_str() );
6542 operator QByteArray()
const
6544 return QByteArray( c_str() );
6547 operator QDate()
const
6549 return QDate::fromString( c_str(), PCL_QDATE_FMT_STR );
6552 operator QDateTime()
const
6554 return QDateTime::fromString( c_str(), PCL_QDATETIME_FMT_STR );
6573 va_start( paramList, fmt );
6575 (void)VFormat( fmt, paramList );
6577 va_end( paramList );
6595 va_start( paramList, fmt );
6597 (void)AppendVFormat( fmt, paramList );
6599 va_end( paramList );
6647 for (
const_iterator i = m_data->string; i < m_data->end; ++p, ++i )
6678 #ifdef __PCL_QT_INTERFACE
6680 QString ToQString()
const
6682 return operator QString();
6685 QByteArray ToQByteArray()
const
6687 return operator QByteArray();
6690 QDate ToQDate()
const
6692 return operator QDate();
6695 QDateTime ToQDateTime()
const
6697 return operator QDateTime();
6849 return TryToInt( value, 0 );
6946 return TryToUInt( value, 0 );
7002 return ToInt64( 0 );
7031 return TryToInt64( value, 0 );
7085 return ToUInt64( 0 );
7114 return TryToUInt64( value, 0 );
7150 bool TryToUInt64(
unsigned long long& value,
int base )
const noexcept;
7218 #ifndef __PCL_NO_STRING_VECTOR
7269 int sign, s1, s2;
double s3;
7270 ParseSexagesimal( sign, s1, s2, s3, separator );
7271 return sign*(s1 + (s2 + s3/60)/60);
7274 double SexagesimalToDouble(
char separator )
const
7276 return SexagesimalToDouble(
IsoString( separator ) );
7279 double SexagesimalToDouble(
const ustring_base& separator )
const
7281 return SexagesimalToDouble( IsoString( separator ) );
7299 int sign, s1, s2;
double s3;
7300 ParseSexagesimal( sign, s1, s2, s3, separators );
7301 return sign*(s1 + (s2 + s3/60)/60);
7323 int sign, s1, s2;
double s3;
7324 if ( TryParseSexagesimal( sign, s1, s2, s3, separator ) )
7326 value = sign*(s1 + (s2 + s3/60)/60);
7332 bool TrySexagesimalToDouble(
double& value,
char separator )
const noexcept
7334 return TrySexagesimalToDouble( value,
IsoString( separator ) );
7337 bool TrySexagesimalToDouble(
double& value,
const ustring_base& separator )
const noexcept
7339 return TrySexagesimalToDouble( value, IsoString( separator ) );
7356 int sign, s1, s2;
double s3;
7357 if ( TryParseSexagesimal( sign, s1, s2, s3, separators ) )
7359 value = sign*(s1 + (s2 + s3/60)/60);
7393 void ParseSexagesimal(
int& sign,
int& s1,
int& s2,
double& s3,
char separator )
const
7395 ParseSexagesimal( sign, s1, s2, s3,
IsoString( separator ) );
7398 void ParseSexagesimal(
int& sign,
int& s1,
int& s2,
double& s3,
const ustring_base& separator )
const
7400 ParseSexagesimal( sign, s1, s2, s3,
IsoString( separator ) );
7435 bool TryParseSexagesimal(
int& sign,
int& s1,
int& s2,
double& s3,
char separator ) const noexcept
7437 return TryParseSexagesimal( sign, s1, s2, s3,
IsoString( separator ) );
7440 bool TryParseSexagesimal(
int& sign,
int& s1,
int& s2,
double& s3,
const ustring_base& separator )
const noexcept
7442 return TryParseSexagesimal( sign, s1, s2, s3,
IsoString( separator ) );
7499 return ToSexagesimal( (d < 0) ? -1 : +1,
Abs( d ), 0, 0, options );
7616 return ToHex( c.Begin(), c.Length()*
sizeof( *c.Begin() ) );
7648 return ToBase64( c.Begin(), c.Length()*
sizeof( *c.Begin() ) );
7667 IsoString b64 = ToBase64( data, length );
7672 else if ( c ==
'/' )
7691 return ToBase64URL( c.Begin(), c.Length()*
sizeof( *c.Begin() ) );
7749 else if ( c ==
'_' )
7812 return std::move( s1 );
7834 return std::move( s2 );
7856 return std::move( s1 );
7878 return std::move( s1 );
7914 return std::move( s1 );
7948 return std::move( s2 );
7984 return std::move( s1 );
8018 return std::move( s2 );
8091 #ifndef __PCL_NO_STRING_OSTREAM
8093 inline std::ostream&
operator <<( std::ostream& o,
const IsoString& s )
8095 return o << s.c_str();
8154 using c16_string = char16_t*;
8159 using const_c16_string =
const char16_t*;
8307 :
String( l.begin(), l.end() )
8401 String( std::initializer_list<char8_type> l )
8402 :
String( l.begin(), l.end() )
8421 Assign( x ?
"true" :
"false" );
8431 (void)Format( L
"%hd", x );
8441 (void)Format( L
"%hu", x );
8451 (void)Format( L
"%i", x );
8461 (void)Format( L
"%u", x );
8471 (void)Format( L
"%ld", x );
8481 (void)Format( L
"%lu", x );
8491 (void)Format( L
"%lli", x );
8501 (void)Format( L
"%llu", x );
8511 (void)Format( L
"%.7g", x );
8521 (void)Format( L
"%.16g", x );
8532 (void)Format( L
"%.16Lg", x );
8534 (void)Format( L
"%.18Lg", x );
8538 #ifndef __PCL_NO_STRING_COMPLEX
8546 (void)Format( L
"{%.7g,%.7g}", x.
Real(), x.
Imag() );
8555 (void)Format( L
"{%.16g,%.16g}", x.
Real(), x.
Imag() );
8565 (void)Format( L
"{%.16Lg,%.16Lg}", x.
Real(), x.
Imag() );
8567 (void)Format( L
"{%.18Lg,%.18Lg}", x.
Real(), x.
Imag() );
8573 #ifdef __PCL_QT_INTERFACE
8576 String(
const QString& qs )
8577 : string_base( qs.isEmpty() ? iterator( nullptr ) : iterator( PCL_GET_CHAR16PTR_FROM_QSTRING( qs ) ) )
8582 String(
const QDate& qd )
8583 : string_base( iterator( PCL_GET_CHAR16PTR_FROM_QSTRING( qd.toString( PCL_QDATE_FMT_STR ) ) ) )
8588 String(
const QDateTime& qdt )
8589 : string_base( iterator( PCL_GET_CHAR16PTR_FROM_QSTRING( qdt.toString( PCL_QDATETIME_FMT_STR ) ) ) )
8602 string_base::Assign( s );
8611 string_base::Transfer( s );
8621 string_base::Assign( s );
8631 string_base::Transfer( s );
8651 string_base::Assign( t );
8661 string_base::Assign( c );
8725 #ifdef __PCL_QT_INTERFACE
8727 String& operator =(
const QString& qs )
8732 string_base::Assign( PCL_GET_CHAR16PTR_FROM_QSTRING( qs ) );
8736 String& operator =(
const QDate& qd )
8738 string_base::Assign( PCL_GET_CHAR16PTR_FROM_QSTRING( qd.toString( PCL_QDATE_FMT_STR ) ) );
8742 String& operator =(
const QDateTime& qdt )
8744 string_base::Assign( PCL_GET_CHAR16PTR_FROM_QSTRING( qdt.toString( PCL_QDATETIME_FMT_STR ) ) );
8757 string_base::Assign( s );
8766 string_base::Assign( s, i, n );
8774 string_base::Assign( t );
8783 string_base::Assign( i, j );
8792 void Assign( std::initializer_list<char_type> l )
8794 Assign( l.begin(), l.end() );
8804 string_base::Assign( t, i, n );
8812 string_base::Assign( c, n );
8830 string_base::Assign(
reinterpret_cast<const_iterator>( t ), i, n );
8838 string_base::Assign(
char_type( c ), n );
8858 string_base::Assign(
char_type( c ), n );
8869 MaybeReallocate( n );
8872 for (
iterator i = m_data->string; i < m_data->end; ++i, ++t )
8885 size_type n = char8_traits::Length( t );
8888 MaybeReallocate( n );
8890 for (
iterator i = m_data->string; i < m_data->end; ++i, ++t )
8904 size_type len = char8_traits::Length( t );
8908 MaybeReallocate( n );
8911 for (
iterator i = m_data->string; i < m_data->end; ++i, ++t )
8926 MaybeReallocate( q - p );
8928 for (
iterator i = m_data->string; i < m_data->end; ++i, ++p )
8942 void Assign( std::initializer_list<char8_type> l )
8944 Assign( l.begin(), l.end() );
8952 string_base::Assign(
char_type( c ), n );
8959 string_base::Insert( i, s );
8962 void Insert(
size_type i, const_iterator p, const_iterator q )
8964 string_base::Insert( i, p, q );
8967 void Insert(
size_type i, const_iterator t )
8969 string_base::Insert( i, t );
8974 string_base::Insert( i, t, n );
8979 string_base::Insert( i, c, n );
8982 void Insert(
size_type i,
const char16_t* t )
8984 string_base::Insert( i,
reinterpret_cast<const_iterator
>( t ) );
8989 string_base::Insert( i, String( c, n ) );
8992 void Insert(
size_type i,
const wchar_t* t )
8994 #ifdef __PCL_WINDOWS
8995 string_base::Insert( i,
reinterpret_cast<const_iterator
>( t ) );
8997 string_base::Insert( i, String( t ) );
9003 string_base::Insert( i, String( c, n ) );
9011 UninitializedGrow( i, n );
9012 const_char8_iterator t = s.Begin();
9014 for ( iterator p = m_data->string+i, q = p+n; p < q; ++p, ++t )
9015 *p = char_type(
uint8( *t ) );
9019 void Insert(
size_type i,
const string8_base& s )
9024 UninitializedGrow( i, n );
9025 const_char8_iterator t = s.Begin();
9027 for ( iterator p = m_data->string+i, q = p+n; p < q; ++p, ++t )
9028 *p = char_type(
uint8( *t ) );
9032 void Insert(
size_type i, const_c_string8 t )
9034 size_type n = char8_traits::Length( t );
9037 UninitializedGrow( i, n );
9039 for ( iterator p = m_data->string+i, q = p+n; p < q; ++p, ++t )
9040 *p = char_type(
uint8( *t ) );
9046 n =
pcl::Min( n, char8_traits::Length( t ) );
9049 UninitializedGrow( i, n );
9051 for ( iterator p = m_data->string+i, q = p+n; p < q; ++p, ++t )
9052 *p = char_type(
uint8( *t ) );
9056 void Insert(
size_type i, const_char8_iterator p, const_char8_iterator q )
9061 UninitializedGrow( i, n );
9063 for ( iterator r = m_data->string+i, s = r+n; r < s; ++r, ++p )
9064 *r = char_type(
uint8( *p ) );
9070 string_base::Insert( i, char_type( c ), n );
9075 void Append(
const String& s )
9077 string_base::Append( s );
9080 String& operator +=(
const String& s )
9086 void Append( const_iterator i, const_iterator j )
9088 string_base::Append( i, j );
9091 void Append( const_iterator t )
9093 string_base::Append( t );
9096 String& operator +=( const_iterator t )
9102 void Append( const_iterator t,
size_type n )
9104 string_base::Append( t, n );
9107 void Append( char_type c,
size_type n = 1 )
9109 string_base::Append( c, n );
9112 String& operator +=( char_type c )
9118 void Append(
const char16_t* t )
9120 string_base::Append(
reinterpret_cast<const_iterator
>( t ) );
9123 String& operator +=(
const char16_t* t )
9129 void Append( char16_t c,
size_type n = 1 )
9131 string_base::Append( char_type( c ), n );
9134 String& operator +=( char16_t c )
9140 void Append(
const wchar_t* t )
9142 #ifdef __PCL_WINDOWS
9143 string_base::Append(
reinterpret_cast<const_iterator
>( t ) );
9145 string_base::Append( String( t ) );
9149 String& operator +=(
const wchar_t* t )
9155 void Append(
wchar_t c,
size_type n = 1 )
9157 string_base::Append( char_type( c ), n );
9160 String& operator +=(
wchar_t c )
9166 void Append(
const string8_base& s )
9168 Insert( maxPos, s );
9171 String& operator +=(
const string8_base& s )
9177 void Append(
const string8_base& s,
size_type n )
9179 Insert( maxPos, s, n );
9182 void Append( const_c_string8 t )
9184 Insert( maxPos, t );
9187 String& operator +=( const_c_string8 t )
9193 void Append( const_c_string8 t,
size_type n )
9195 Insert( maxPos, t, n );
9198 void Append( const_char8_iterator p, const_char8_iterator q )
9200 Insert( maxPos, p, q );
9203 void Append( char8_type c,
size_type n = 1 )
9205 string_base::Append( char_type( c ), n );
9208 String& operator +=( char8_type c )
9214 void Add(
const String& s )
9219 void Add( const_iterator i, const_iterator j )
9224 void Add( const_iterator t )
9229 void Add( const_iterator t,
size_type n )
9234 void Add( char_type c,
size_type n = 1 )
9239 void Add(
const char16_t* t )
9249 void Add(
const wchar_t* t )
9259 void Add(
const string8_base& s )
9264 void Add(
const string8_base& s,
size_type n )
9269 void Add( const_c_string8 t )
9274 void Add( const_c_string8 t,
size_type n )
9279 void Add( const_char8_iterator p, const_char8_iterator q )
9284 void Add( char8_type c,
size_type n = 1 )
9291 void Prepend(
const String& s )
9293 string_base::Prepend( s );
9296 String& operator -=(
const String& s )
9302 void Prepend( const_iterator i, const_iterator j )
9304 string_base::Prepend( i, j );
9307 void Prepend( const_iterator t )
9309 string_base::Prepend( t );
9312 String& operator -=( const_iterator t )
9318 void Prepend( const_iterator t,
size_type n )
9320 string_base::Prepend( t, n );
9323 void Prepend( char_type c,
size_type n = 1 )
9325 string_base::Prepend( c, n );
9328 String& operator -=( char_type c )
9334 void Prepend(
const char16_t* t )
9336 string_base::Prepend(
reinterpret_cast<const_iterator
>( t ) );
9339 String& operator -=(
const char16_t* t )
9345 void Prepend( char16_t c,
size_type n = 1 )
9347 string_base::Prepend( char_type( c ), n );
9350 String& operator -=( char16_t c )
9356 void Prepend(
const wchar_t* t )
9358 #ifdef __PCL_WINDOWS
9359 string_base::Prepend(
reinterpret_cast<const_iterator
>( t ) );
9361 string_base::Prepend( String( t ) );
9365 String& operator -=(
const wchar_t* t )
9371 void Prepend(
wchar_t c,
size_type n = 1 )
9373 string_base::Prepend( char_type( c ), n );
9376 String& operator -=(
wchar_t c )
9382 void Prepend(
const string8_base& s )
9387 String& operator -=(
const string8_base& s )
9393 void Prepend(
const string8_base& s,
size_type n )
9398 void Prepend( const_c_string8 t )
9403 String& operator -=( const_c_string8 t )
9409 void Prepend( const_c_string8 t,
size_type n )
9414 void Prepend( const_char8_iterator p, const_char8_iterator q )
9419 void Prepend( char8_type c,
size_type n = 1 )
9421 string_base::Prepend( String( c, n ) );
9424 String& operator -=( char8_type c )
9434 string_base::Replace( i, n, s );
9439 string_base::Replace( i, n, t );
9444 string_base::Replace( i, n, c, nc );
9449 string_base::Replace( i, n,
reinterpret_cast<const_iterator
>( t ) );
9454 string_base::Replace( i, n, char_type( c ), nc );
9459 #ifdef __PCL_WINDOWS
9460 string_base::Replace( i, n,
reinterpret_cast<const_iterator
>( t ) );
9462 string_base::Replace( i, n, String( t ) );
9468 string_base::Replace( i, n, char_type( c ), nc );
9483 size_type nt = char8_traits::Length( t );
9487 UninitializedGrow( i, nt-n );
9494 for ( iterator p = m_data->string+i, q = p+nt; p < q; ++p, ++t )
9495 *p = char_type( *t );
9506 string_base::Replace( i, n, char_type( c ), nc );
9511 void ReplaceChar( char_type c1, char_type c2,
size_type i = 0,
size_type n = maxPos )
9513 string_base::ReplaceChar( c1, c2, i, n );
9516 void ReplaceCharIC( char_type c1, char_type c2,
size_type i = 0,
size_type n = maxPos )
9518 string_base::ReplaceCharIC( c1, c2, i, n );
9523 string_base::ReplaceChar( char_type( c1 ), char_type( c2 ), i, n );
9526 void ReplaceCharIC( char16_t c1, char16_t c2,
size_type i = 0,
size_type n = maxPos )
9528 string_base::ReplaceCharIC( char_type( c1 ), char_type( c2 ), i, n );
9533 string_base::ReplaceChar( char_type( c1 ), char_type( c2 ), i, n );
9538 string_base::ReplaceCharIC( char_type( c1 ), char_type( c2 ), i, n );
9541 void ReplaceChar( char8_type c1, char8_type c2,
size_type i = 0,
size_type n = maxPos )
9543 string_base::ReplaceChar( char_type( c1 ), char_type( c2 ), i, n );
9546 void ReplaceCharIC( char8_type c1, char8_type c2,
size_type i = 0,
size_type n = maxPos )
9548 string_base::ReplaceCharIC( char_type( c1 ), char_type( c2 ), i, n );
9553 void ReplaceString(
const String& s1,
const String& s2,
size_type i = 0 )
9555 string_base::ReplaceString( s1, s2, i );
9558 void ReplaceStringIC(
const String& s1,
const String& s2,
size_type i = 0 )
9560 string_base::ReplaceStringIC( s1, s2, i );
9563 void ReplaceString( const_iterator t1, const_iterator t2,
size_type i = 0 )
9565 string_base::ReplaceString( t1, t2, i );
9568 void ReplaceStringIC( const_iterator t1, const_iterator t2,
size_type i = 0 )
9570 string_base::ReplaceStringIC( t1, t2, i );
9573 void ReplaceString(
const char16_t* t1,
const char16_t* t2,
size_type i = 0 )
9575 string_base::ReplaceString(
reinterpret_cast<const_iterator
>( t1 ),
9576 reinterpret_cast<const_iterator
>( t2 ), i );
9579 void ReplaceStringIC(
const char16_t* t1,
const char16_t* t2,
size_type i = 0 )
9581 string_base::ReplaceStringIC(
reinterpret_cast<const_iterator
>( t1 ),
9582 reinterpret_cast<const_iterator
>( t2 ), i );
9585 void ReplaceString(
const wchar_t* t1,
const wchar_t* t2,
size_type i = 0 )
9587 #ifdef __PCL_WINDOWS
9588 string_base::ReplaceString(
reinterpret_cast<const_iterator
>( t1 ),
9589 reinterpret_cast<const_iterator
>( t2 ), i );
9591 string_base::ReplaceString( String( t1 ), String( t2 ), i );
9595 void ReplaceStringIC(
const wchar_t* t1,
const wchar_t* t2,
size_type i = 0 )
9597 #ifdef __PCL_WINDOWS
9598 string_base::ReplaceStringIC(
reinterpret_cast<const_iterator
>( t1 ),
9599 reinterpret_cast<const_iterator
>( t2 ), i );
9601 string_base::ReplaceStringIC( String( t1 ), String( t2 ), i );
9605 void ReplaceString( const_c_string8 t1, const_c_string8 t2,
size_type i = 0 )
9607 string_base::ReplaceString( String( t1 ), String( t2 ), i );
9610 void ReplaceStringIC( const_c_string8 t1, const_c_string8 t2,
size_type i = 0 )
9612 string_base::ReplaceStringIC( String( t1 ), String( t2 ), i );
9617 void DeleteChar( char_type c,
size_type i = 0 )
9619 string_base::DeleteChar( c, i );
9622 void DeleteCharIC( char_type c,
size_type i = 0 )
9624 string_base::DeleteCharIC( c, i );
9627 void DeleteChar( char16_t c,
size_type i = 0 )
9629 string_base::DeleteChar( char_type( c ), i );
9632 void DeleteCharIC( char16_t c,
size_type i = 0 )
9634 string_base::DeleteCharIC( char_type( c ), i );
9637 void DeleteChar(
wchar_t c,
size_type i = 0 )
9639 string_base::DeleteChar( char_type( c ), i );
9642 void DeleteCharIC(
wchar_t c,
size_type i = 0 )
9644 string_base::DeleteCharIC( char_type( c ), i );
9647 void DeleteChar( char8_type c,
size_type i = 0 )
9649 string_base::DeleteChar( char_type( c ), i );
9652 void DeleteCharIC( char8_type c,
size_type i = 0 )
9654 string_base::DeleteCharIC( char_type( c ), i );
9659 void DeleteString(
const String& s,
size_type i = 0 )
9661 string_base::DeleteString( s, i );
9664 void DeleteStringIC(
const String& s,
size_type i = 0 )
9666 string_base::DeleteStringIC( s, i );
9669 void DeleteString( const_iterator t,
size_type i = 0 )
9671 string_base::DeleteString( t, i );
9674 void DeleteStringIC( const_iterator t,
size_type i = 0 )
9676 string_base::DeleteStringIC( t, i );
9679 void DeleteString(
const char16_t* t,
size_type i = 0 )
9681 string_base::DeleteString(
reinterpret_cast<const_iterator
>( t ), i );
9684 void DeleteStringIC(
const char16_t* t,
size_type i = 0 )
9686 string_base::DeleteStringIC(
reinterpret_cast<const_iterator
>( t ), i );
9689 void DeleteString(
const wchar_t* t,
size_type i = 0 )
9691 #ifdef __PCL_WINDOWS
9692 string_base::DeleteString(
reinterpret_cast<const_iterator
>( t ), i );
9694 string_base::DeleteString( String( t ), i );
9698 void DeleteStringIC(
const wchar_t* t,
size_type i = 0 )
9700 #ifdef __PCL_WINDOWS
9701 string_base::DeleteStringIC(
reinterpret_cast<const_iterator
>( t ), i );
9703 string_base::DeleteStringIC( String( t ), i );
9707 void DeleteString( const_c_string8 t,
size_type i = 0 )
9709 string_base::DeleteString( String( t ), i );
9712 void DeleteStringIC( const_c_string8 t,
size_type i = 0 )
9714 string_base::DeleteStringIC( String( t ), i );
9719 bool StartsWith(
const String& s )
const noexcept
9721 return string_base::StartsWith( s );
9724 bool StartsWith( const_iterator t )
const noexcept
9726 return string_base::StartsWith( t );
9729 bool StartsWith( char_type c )
const noexcept
9731 return string_base::StartsWith( c );
9734 bool StartsWithIC(
const String& s )
const noexcept
9736 return string_base::StartsWithIC( s );
9739 bool StartsWithIC( const_iterator t )
const noexcept
9741 return string_base::StartsWithIC( t );
9744 bool StartsWithIC( char_type c )
const noexcept
9746 return string_base::StartsWithIC( c );
9749 bool StartsWith(
const char16_t* t )
const noexcept
9751 return string_base::StartsWith(
reinterpret_cast<const_iterator
>( t ) );
9754 bool StartsWith( char16_t c )
const noexcept
9756 return string_base::StartsWith( char_type( c ) );
9759 bool StartsWithIC(
const char16_t* t )
const noexcept
9761 return string_base::StartsWithIC(
reinterpret_cast<const_iterator
>( t ) );
9764 bool StartsWithIC( char16_t c )
const noexcept
9766 return string_base::StartsWithIC( char_type( c ) );
9769 bool StartsWith(
const wchar_t* t )
const noexcept
9771 #ifdef __PCL_WINDOWS
9772 return string_base::StartsWith(
reinterpret_cast<const_iterator
>( t ) );
9774 return string_base::StartsWith( String( t ) );
9778 bool StartsWith(
wchar_t c )
const noexcept
9780 return string_base::StartsWith( char_type( c ) );
9783 bool StartsWithIC(
const wchar_t* t )
const noexcept
9785 #ifdef __PCL_WINDOWS
9786 return string_base::StartsWithIC(
reinterpret_cast<const_iterator
>( t ) );
9788 return string_base::StartsWithIC( String( t ) );
9792 bool StartsWithIC(
wchar_t c )
const noexcept
9794 return string_base::StartsWithIC( char_type( c ) );
9797 bool StartsWith( const_c_string8 t )
const noexcept
9799 size_type n = char8_traits::Length( t );
9800 if ( n == 0 || Length() < n )
9802 for ( const_iterator p = m_data->string, q = p+n; p < q; ++p, ++t )
9803 if ( *p != char_type( *t ) )
9808 bool StartsWith( char8_type c )
const noexcept
9810 return string_base::StartsWith( char_type( c ) );
9813 bool StartsWithIC( const_c_string8 t )
const noexcept
9815 size_type n = char8_traits::Length( t );
9816 if ( n == 0 || Length() < n )
9818 for ( const_iterator p = m_data->string, q = p+n; p < q; ++p, ++t )
9819 if ( char_traits::ToCaseFolded( *p ) != char_type( char8_traits::ToCaseFolded( *t ) ) )
9824 bool StartsWithIC( char8_type c )
const noexcept
9826 return string_base::StartsWithIC( char_type( c ) );
9831 bool EndsWith(
const String& s )
const noexcept
9833 return string_base::EndsWith( s );
9836 bool EndsWith( const_iterator t )
const noexcept
9838 return string_base::EndsWith( t );
9841 bool EndsWith( char_type c )
const noexcept
9843 return string_base::EndsWith( c );
9846 bool EndsWithIC(
const String& s )
const noexcept
9848 return string_base::EndsWithIC( s );
9851 bool EndsWithIC( const_iterator t )
const noexcept
9853 return string_base::EndsWithIC( t );
9856 bool EndsWithIC( char_type c )
const noexcept
9858 return string_base::EndsWithIC( c );
9861 bool EndsWith(
const char16_t* t )
const noexcept
9863 return string_base::EndsWith(
reinterpret_cast<const_iterator
>( t ) );
9866 bool EndsWith( char16_t c )
const noexcept
9868 return string_base::EndsWith( char_type( c ) );
9871 bool EndsWithIC(
const char16_t* t )
const noexcept
9873 return string_base::EndsWithIC(
reinterpret_cast<const_iterator
>( t ) );
9876 bool EndsWithIC( char16_t c )
const noexcept
9878 return string_base::EndsWithIC( char_type( c ) );
9881 bool EndsWith(
const wchar_t* t )
const noexcept
9883 #ifdef __PCL_WINDOWS
9884 return string_base::EndsWith(
reinterpret_cast<const_iterator
>( t ) );
9886 return string_base::EndsWith( String( t ) );
9890 bool EndsWith(
wchar_t c )
const noexcept
9892 return string_base::EndsWith( char_type( c ) );
9895 bool EndsWithIC(
const wchar_t* t )
const noexcept
9897 #ifdef __PCL_WINDOWS
9898 return string_base::EndsWithIC(
reinterpret_cast<const_iterator
>( t ) );
9900 return string_base::EndsWithIC( String( t ) );
9904 bool EndsWithIC(
wchar_t c )
const noexcept
9906 return string_base::EndsWithIC( char_type( c ) );
9909 bool EndsWith( const_c_string8 t )
const noexcept
9911 size_type n = char8_traits::Length( t );
9912 if ( n == 0 || Length() < n )
9914 for ( const_iterator p = m_data->end-n; p < m_data->end; ++p, ++t )
9915 if ( *p != char_type( *t ) )
9920 bool EndsWith( char8_type c )
const noexcept
9922 return string_base::EndsWith( char_type( c ) );
9925 bool EndsWithIC( const_c_string8 t )
const noexcept
9927 size_type n = char8_traits::Length( t );
9928 if ( n == 0 || Length() < n )
9930 for ( const_iterator p = m_data->end-n; p < m_data->end; ++p, ++t )
9931 if ( char_traits::ToCaseFolded( *p ) != char_type( char8_traits::ToCaseFolded( *t ) ) )
9936 bool EndsWithIC( char8_type c )
const noexcept
9938 return string_base::EndsWithIC( char_type( c ) );
9945 return string_base::FindFirst( s, i );
9950 return string_base::FindFirst( t, i );
9955 return string_base::FindFirst( c, i );
9960 return string_base::FindFirstIC( s, i );
9965 return string_base::FindFirstIC( t, i );
9970 return string_base::FindFirstIC( c, i );
9975 return string_base::FindFirst(
reinterpret_cast<const_iterator
>( t ), i );
9980 return string_base::FindFirst( char_type( c ), i );
9985 return string_base::FindFirstIC(
reinterpret_cast<const_iterator
>( t ), i );
9990 return string_base::FindFirstIC( char_type( c ), i );
9995 #ifdef __PCL_WINDOWS
9996 return string_base::FindFirst(
reinterpret_cast<const_iterator
>( t ), i );
9998 return string_base::FindFirst( String( t ), i );
10004 return string_base::FindFirst( char_type( c ), i );
10009 #ifdef __PCL_WINDOWS
10010 return string_base::FindFirstIC(
reinterpret_cast<const_iterator
>( t ), i );
10012 return string_base::FindFirstIC( String( t ), i );
10018 return string_base::FindFirstIC( char_type( c ), i );
10023 return string_base::FindFirst( String( t ), i );
10028 return string_base::FindFirst( char_type( c ), i );
10033 return string_base::FindFirstIC( String( t ), i );
10038 return string_base::FindFirstIC( char_type( c ), i );
10045 return FindFirst( s, i );
10050 return FindFirst( t, i );
10055 return FindFirst( c, i );
10060 return FindFirst( t, i );
10065 return FindFirst( c, i );
10070 return FindFirst( t, i );
10075 return FindFirst( c, i );
10080 return FindFirst( t, i );
10085 return FindFirst( c, i );
10090 return FindFirstIC( s, i );
10095 return FindFirstIC( t, i );
10100 return FindFirstIC( c, i );
10105 return FindFirstIC( t, i );
10110 return FindFirstIC( c, i );
10115 return FindFirstIC( t, i );
10120 return FindFirstIC( c, i );
10125 return FindFirstIC( t, i );
10130 return FindFirstIC( c, i );
10137 return string_base::FindLast( s, r );
10142 return string_base::FindLast( t, r );
10147 return string_base::FindLast( c, r );
10152 return string_base::FindLastIC( s, r );
10157 return string_base::FindLastIC( t, r );
10162 return string_base::FindLastIC( c, r );
10167 return string_base::FindLast(
reinterpret_cast<const_iterator
>( t ), r );
10172 return string_base::FindLast( char_type( c ), r );
10177 return string_base::FindLastIC(
reinterpret_cast<const_iterator
>( t ), r );
10182 return string_base::FindLastIC( char_type( c ), r );
10187 #ifdef __PCL_WINDOWS
10188 return string_base::FindLast(
reinterpret_cast<const_iterator
>( t ), r );
10190 return string_base::FindLast( String( t ), r );
10196 return string_base::FindLast( char_type( c ), r );
10201 #ifdef __PCL_WINDOWS
10202 return string_base::FindLastIC(
reinterpret_cast<const_iterator
>( t ), r );
10204 return string_base::FindLastIC( String( t ), r );
10210 return string_base::FindLastIC( char_type( c ), r );
10215 return string_base::FindLast( String( t ), r );
10220 return string_base::FindLast( char_type( c ), r );
10225 return string_base::FindLastIC( String( t ), r );
10230 return string_base::FindLastIC( char_type( c ), r );
10235 bool Contains(
const String& s )
const noexcept
10237 return string_base::Contains( s );
10240 bool Contains( const_iterator t )
const noexcept
10242 return string_base::Contains( t );
10245 bool Contains( char_type c )
const noexcept
10247 return string_base::Contains( c );
10250 bool ContainsIC(
const String& s )
const noexcept
10252 return string_base::ContainsIC( s );
10255 bool ContainsIC( const_iterator t )
const noexcept
10257 return string_base::ContainsIC( t );
10260 bool ContainsIC( char_type c )
const noexcept
10262 return string_base::ContainsIC( c );
10265 bool Contains(
const char16_t* t )
const noexcept
10267 return string_base::Contains(
reinterpret_cast<const_iterator
>( t ) );
10270 bool Contains( char16_t c )
const noexcept
10272 return string_base::Contains( char_type( c ) );
10275 bool ContainsIC(
const char16_t* t )
const noexcept
10277 return string_base::ContainsIC(
reinterpret_cast<const_iterator
>( t ) );
10280 bool ContainsIC( char16_t c )
const noexcept
10282 return string_base::ContainsIC( char_type( c ) );
10285 bool Contains(
const wchar_t* t )
const noexcept
10287 #ifdef __PCL_WINDOWS
10288 return string_base::Contains(
reinterpret_cast<const_iterator
>( t ) );
10290 return string_base::Contains( String( t ) );
10294 bool Contains(
wchar_t c )
const noexcept
10296 return string_base::Contains( char_type( c ) );
10299 bool ContainsIC(
const wchar_t* t )
const noexcept
10301 #ifdef __PCL_WINDOWS
10302 return string_base::ContainsIC(
reinterpret_cast<const_iterator
>( t ) );
10304 return string_base::ContainsIC( String( t ) );
10308 bool ContainsIC(
wchar_t c )
const noexcept
10310 return string_base::ContainsIC( char_type( c ) );
10313 bool Contains( const_c_string8 t )
const noexcept
10315 return string_base::Contains( String( t ) );
10318 bool Contains( char8_type c )
const noexcept
10320 return string_base::Contains( char_type( c ) );
10323 bool ContainsIC( const_c_string8 t )
const noexcept
10325 return string_base::ContainsIC( String( t ) );
10328 bool ContainsIC( char8_type c )
const noexcept
10330 return string_base::ContainsIC( char_type( c ) );
10335 int CompareCodePoints(
const String& s,
bool caseSensitive =
true ) const noexcept
10337 return string_base::CompareCodePoints( s, caseSensitive );
10340 int CompareCodePoints( const_iterator t,
bool caseSensitive =
true ) const noexcept
10342 return string_base::CompareCodePoints( t, caseSensitive );
10345 int CompareCodePoints( char_type c,
bool caseSensitive =
true ) const noexcept
10347 return string_base::CompareCodePoints( c, caseSensitive );
10350 int CompareCodePoints(
const char16_t* t,
bool caseSensitive =
true ) const noexcept
10352 return string_base::CompareCodePoints(
reinterpret_cast<const_iterator
>( t ), caseSensitive );
10355 int CompareCodePoints( char16_t c,
bool caseSensitive =
true ) const noexcept
10357 return string_base::CompareCodePoints( char_type( c ), caseSensitive );
10360 int CompareCodePoints(
const wchar_t* t,
bool caseSensitive =
true ) const noexcept
10362 #ifdef __PCL_WINDOWS
10363 return string_base::CompareCodePoints(
reinterpret_cast<const_iterator
>( t ), caseSensitive );
10365 return string_base::CompareCodePoints( String( t ), caseSensitive );
10369 int CompareCodePoints(
wchar_t c,
bool caseSensitive =
true ) const noexcept
10371 return string_base::CompareCodePoints( char_type( c ), caseSensitive );
10374 int CompareCodePoints( const_c_string8 t,
bool caseSensitive =
true ) const noexcept
10376 return string_base::CompareCodePoints( String( t ), caseSensitive );
10379 int CompareCodePoints( char8_type c,
bool caseSensitive =
true ) const noexcept
10381 return string_base::CompareCodePoints( char_type( c ), caseSensitive );
10386 int Compare(
const String& s,
bool caseSensitive =
true,
bool localeAware =
true ) const noexcept
10391 int Compare( const_iterator t,
bool caseSensitive =
true,
bool localeAware =
true ) const noexcept
10396 int Compare( char_type c,
bool caseSensitive =
true,
bool localeAware =
true ) const noexcept
10401 int CompareIC(
const String& s,
bool localeAware =
true ) const noexcept
10403 return string_base::CompareIC( s, localeAware );
10406 int CompareIC( const_iterator t,
bool localeAware =
true ) const noexcept
10408 return string_base::CompareIC( t, localeAware );
10411 int CompareIC( char_type c,
bool localeAware =
true ) const noexcept
10413 return string_base::CompareIC( c, localeAware );
10416 int Compare(
const char16_t* t,
bool caseSensitive =
true,
bool localeAware =
true ) const noexcept
10418 return string_base::Compare(
reinterpret_cast<const_iterator
>( t ), caseSensitive, localeAware );
10421 int Compare( char16_t c,
bool caseSensitive =
true,
bool localeAware =
true ) const noexcept
10426 int CompareIC(
const char16_t* t,
bool localeAware =
true ) const noexcept
10428 return string_base::CompareIC(
reinterpret_cast<const_iterator
>( t ), localeAware );
10431 int CompareIC( char16_t c,
bool localeAware =
true ) const noexcept
10433 return string_base::CompareIC( char_type( c ), localeAware );
10436 int Compare(
const wchar_t* t,
bool caseSensitive =
true,
bool localeAware =
true ) const noexcept
10438 #ifdef __PCL_WINDOWS
10439 return string_base::Compare(
reinterpret_cast<const_iterator
>( t ), caseSensitive, localeAware );
10445 int Compare(
wchar_t c,
bool caseSensitive =
true,
bool localeAware =
true ) const noexcept
10450 int CompareIC(
const wchar_t* t,
bool localeAware =
true ) const noexcept
10452 #ifdef __PCL_WINDOWS
10453 return string_base::CompareIC(
reinterpret_cast<const_iterator
>( t ), localeAware );
10455 return string_base::CompareIC( String( t ), localeAware );
10459 int CompareIC(
wchar_t c,
bool localeAware =
true ) const noexcept
10461 return string_base::CompareIC( char_type( c ), localeAware );
10464 int Compare( const_c_string8 t,
bool caseSensitive =
true,
bool localeAware =
true ) const noexcept
10469 int Compare( char8_type c,
bool caseSensitive =
true,
bool localeAware =
true ) const noexcept
10474 int CompareIC( const_c_string8 t,
bool localeAware =
true ) const noexcept
10476 return string_base::CompareIC( String( t ), localeAware );
10479 int CompareIC( char8_type c,
bool localeAware =
true ) const noexcept
10481 return string_base::CompareIC( char_type( c ), localeAware );
10486 bool WildMatch(
const String& pattern,
bool caseSensitive =
true ) const noexcept
10488 return string_base::WildMatch( pattern, caseSensitive );
10491 bool WildMatchIC(
const String& pattern )
const noexcept
10493 return string_base::WildMatchIC( pattern );
10496 bool WildMatch( const_iterator pattern,
bool caseSensitive =
true ) const noexcept
10498 return string_base::WildMatch( pattern, caseSensitive );
10501 bool WildMatchIC( const_iterator pattern )
const noexcept
10503 return string_base::WildMatchIC( pattern );
10506 bool WildMatch(
const string8_base& pattern,
bool caseSensitive =
true ) const noexcept
10508 return char_traits::WildMatch( m_data->string, Length(), pattern.Begin(), pattern.Length(), caseSensitive );
10511 bool WildMatchIC(
const string8_base& pattern )
const noexcept
10513 return char_traits::WildMatch( m_data->string, Length(), pattern.Begin(), pattern.Length(),
false );
10516 bool WildMatch( const_c_string8 pattern,
bool caseSensitive =
true ) const noexcept
10518 return char_traits::WildMatch( m_data->string, Length(), pattern, char8_traits::Length( pattern ), caseSensitive );
10521 bool WildMatchIC( const_c_string8 pattern )
const noexcept
10523 return char_traits::WildMatch( m_data->string, Length(), pattern, char8_traits::Length( pattern ),
false );
10528 String SetToLength(
size_type n )
const
10530 return string_base::SetToLength( n );
10533 String ResizedToNullTerminated()
const
10535 return string_base::ResizedToNullTerminated();
10538 String Squeezed()
const
10540 return string_base::Squeezed();
10547 return string_base::Substring( i, n );
10552 return string_base::Left( n );
10557 return string_base::Right( n );
10562 return string_base::Suffix( i );
10567 return string_base::Prefix( i );
10573 size_type Break( C& list,
const String& s,
bool trim =
false,
size_type i = 0 )
const
10575 return string_base::Break( list, s, trim, i );
10579 size_type Break( C& list,
const string8_base& s,
bool trim =
false,
size_type i = 0 )
const
10581 return string_base::Break( list, String( s ), trim, i );
10585 size_type Break( C& list, const_c_string8 s,
bool trim =
false,
size_type i = 0 )
const
10587 return string_base::Break( list, String( s ), trim, i );
10593 return string_base::Break( list, c, trim, i );
10599 return string_base::Break( list, char_type( c ), trim, i );
10602 template <
class C,
typename S>
10603 size_type Break( C& list,
const Array<S>& ca,
bool trim =
false,
size_type i = 0 )
const
10605 return string_base::Break( list, ca, trim, i );
10611 size_type BreakIC( C& list,
const String& s,
bool trim =
false,
size_type i = 0 )
const
10613 return string_base::BreakIC( list, s, trim, i );
10617 size_type BreakIC( C& list,
const string8_base& s,
bool trim =
false,
size_type i = 0 )
const
10619 return string_base::BreakIC( list, String( s ), trim, i );
10623 size_type BreakIC( C& list, const_c_string8 s,
bool trim =
false,
size_type i = 0 )
const
10625 return string_base::BreakIC( list, String( s ), trim, i );
10631 return string_base::BreakIC( list, c, trim, i );
10635 size_type BreakIC( C& list, char8_type c,
bool trim =
false,
size_type i = 0 )
const
10637 return string_base::BreakIC( list, char_type( c ), trim, i );
10642 String Trimmed()
const
10644 return string_base::Trimmed();
10647 String TrimmedLeft()
const
10649 return string_base::TrimmedLeft();
10652 String TrimmedRight()
const
10654 return string_base::TrimmedRight();
10661 return string_base::LeftJustified( width, fill );
10666 return string_base::RightJustified( width, fill );
10671 return string_base::CenterJustified( width, fill );
10676 String Enclosed( char_type c )
const
10678 return string_base::Enclosed( c );
10681 String SingleQuoted()
const
10683 return string_base::SingleQuoted();
10686 String DoubleQuoted()
const
10688 return string_base::DoubleQuoted();
10691 String Unquoted()
const
10693 return string_base::Unquoted();
10698 String CaseFolded()
const
10700 return string_base::CaseFolded();
10703 String Lowercase()
const
10705 return string_base::Lowercase();
10708 String Uppercase()
const
10710 return string_base::Uppercase();
10715 String Reversed()
const
10717 return string_base::Reversed();
10720 String Sorted()
const
10722 return string_base::Sorted();
10725 template <
class BP>
10726 String Sorted( BP p )
const
10728 return string_base::Sorted( p );
10746 return c.ToSeparated( *
this, separator );
10765 template <
class C,
class AF>
10769 return c.ToSeparated( *
this, separator, append );
10785 return c.ToSeparated( *
this, separator );
10804 template <
class C,
class AF>
10808 return c.ToSeparated( *
this, separator, append );
10823 return ToSeparated( c,
String( separator ) );
10842 template <
class C,
class AF>
10845 return ToSeparated( c,
String( separator ), append );
10861 return ToSeparated( c,
String( separator ) );
10880 template <
class C,
class AF>
10883 return ToSeparated( c,
String( separator ), append );
11051 #ifdef __PCL_QT_INTERFACE
11053 operator QString()
const
11055 return PCL_GET_QSTRING_FROM_CHAR16PTR( c_str() );
11058 operator QDate()
const
11060 return QDate::fromString(
operator QString(), PCL_QDATE_FMT_STR );
11063 operator QDateTime()
const
11065 return QDateTime::fromString(
operator QString(), PCL_QDATETIME_FMT_STR );
11084 va_start( paramList, fmt );
11086 (void)VFormat( fmt, paramList );
11088 va_end( paramList );
11106 va_start( paramList, fmt );
11108 (void)AppendVFormat( fmt, paramList );
11110 va_end( paramList );
11129 int count = s.
VFormat( fmt, paramList );
11149 int count = s.
VFormat( fmt, paramList );
11169 va_start( paramList, fmt );
11171 (void)VFormat( fmt, paramList );
11173 va_end( paramList );
11192 va_start( paramList, fmt );
11194 (void)AppendVFormat( fmt, paramList );
11196 va_end( paramList );
11309 return UTF16ToUTF8( Begin(), i, n );
11339 #ifdef __PCL_WINDOWS
11375 #ifdef __PCL_WINDOWS
11376 char_traits::Copy(
reinterpret_cast<iterator>( a.Begin() ), m_data->string+i, n );
11379 for (
const_iterator s = m_data->string+i, e = s+n; s < e; ++w, ++s )
11380 *w = wchar_t( *s );
11399 return UTF16ToUTF32( Begin(), i, n );
11402 #ifdef __PCL_QT_INTERFACE
11404 QString ToQString()
const
11406 return operator QString();
11409 QDate ToQDate()
const
11411 return operator QDate();
11414 QDateTime ToQDateTime()
const
11416 return operator QDateTime();
11567 return TryToInt( value, 0 );
11636 return ToUInt( 0 );
11664 return TryToUInt( value, 0 );
11720 return ToInt64( 0 );
11749 return TryToInt64( value, 0 );
11803 return ToUInt64( 0 );
11832 return TryToUInt64( value, 0 );
11936 #ifndef __PCL_NO_STRING_VECTOR
11987 int sign, s1, s2;
double s3;
11988 ParseSexagesimal( sign, s1, s2, s3, separator );
11989 return sign*(s1 + (s2 + s3/60)/60);
12007 int sign, s1, s2;
double s3;
12008 ParseSexagesimal( sign, s1, s2, s3, separators );
12009 return sign*(s1 + (s2 + s3/60)/60);
12031 int sign, s1, s2;
double s3;
12032 if ( TryParseSexagesimal( sign, s1, s2, s3, separator ) )
12034 value = sign*(s1 + (s2 + s3/60)/60);
12054 int sign, s1, s2;
double s3;
12055 if ( TryParseSexagesimal( sign, s1, s2, s3, separators ) )
12057 value = sign*(s1 + (s2 + s3/60)/60);
12136 bool TryParseSexagesimal(
int& sign,
int& s1,
int& s2,
double& s3, const
Array<
char_type>& separators ) const noexcept;
12162 static
String ToSexagesimal(
int sign,
double s1,
double s2,
double s3,
12177 return ToSexagesimal( (d < 0) ? -1 : +1,
Abs( d ), 0, 0, options );
12300 m_data->Allocate( n =
pcl::Min( n, len-p ) );
12302 for (
iterator i = m_data->string; i < m_data->
end; ++i, ++t )
12312 MaybeReallocate( len );
12313 for (
iterator i = m_data->string; i < m_data->
end; ++i, ++t )
12353 return String( std::move( s1 ) );
12364 return std::move( s1 );
12375 return String( std::move( s2 ) );
12386 return std::move( s2 );
12397 return String( std::move( s1 ) );
12408 return std::move( s1 );
12419 return String( std::move( s1 ) );
12430 return std::move( s1 );
12455 return String( std::move( s1 ) );
12466 return std::move( s1 );
12489 return String( std::move( s2 ) );
12500 return std::move( s2 );
12525 return String( std::move( s1 ) );
12536 return std::move( s1 );
12559 return String( std::move( s2 ) );
12570 return std::move( s2 );
12594 String s = std::move( s1 );
12607 return std::move( s1 );
12629 String s = std::move( s2 );
12642 return std::move( s2 );
12666 String s = std::move( s1 );
12679 return std::move( s1 );
12701 String s = std::move( s2 );
12714 return std::move( s2 );
12738 String s = std::move( s1 );
12751 return std::move( s1 );
12773 String s = std::move( s2 );
12786 return std::move( s2 );
12810 String s = std::move( s1 );
12823 return std::move( s1 );
12845 String s = std::move( s2 );
12858 return std::move( s2 );
12882 String s = std::move( s1 );
12895 return std::move( s1 );
12917 String s = std::move( s2 );
12930 return std::move( s2 );
12954 String s = std::move( s1 );
12967 return std::move( s1 );
12989 String s = std::move( s2 );
13002 return std::move( s2 );
13027 return String( std::move( s1 ) );
13038 return std::move( s1 );
13061 return String( std::move( s2 ) );
13072 return std::move( s2 );
13309 return s1.CompareCodePoints( t2 ) == 0;
13320 return s1.CompareCodePoints( t2 ) < 0;
13331 return s1.CompareCodePoints( t2 ) <= 0;
13342 return s1.CompareCodePoints( t2 ) > 0;
13353 return s1.CompareCodePoints( t2 ) >= 0;
13364 return s2.CompareCodePoints( t1 ) == 0;
13375 return s2.CompareCodePoints( t1 ) > 0;
13386 return s2.CompareCodePoints( t1 ) >= 0;
13397 return s2.CompareCodePoints( t1 ) < 0;
13408 return s2.CompareCodePoints( t1 ) <= 0;
13419 return s1.CompareCodePoints( c2 ) == 0;
13430 return s1.CompareCodePoints( c2 ) < 0;
13441 return s1.CompareCodePoints( c2 ) <= 0;
13452 return s1.CompareCodePoints( c2 ) > 0;
13463 return s1.CompareCodePoints( c2 ) >= 0;
13474 return s2.CompareCodePoints( c1 ) == 0;
13485 return s2.CompareCodePoints( c1 ) > 0;
13496 return s2.CompareCodePoints( c1 ) >= 0;
13507 return s2.CompareCodePoints( c1 ) < 0;
13518 return s2.CompareCodePoints( c1 ) <= 0;
13529 return s1.CompareCodePoints( t2 ) == 0;
13540 return s1.CompareCodePoints( t2 ) < 0;
13551 return s1.CompareCodePoints( t2 ) <= 0;
13562 return s1.CompareCodePoints( t2 ) > 0;
13573 return s1.CompareCodePoints( t2 ) >= 0;
13584 return s2.CompareCodePoints( t1 ) == 0;
13595 return s2.CompareCodePoints( t1 ) > 0;
13606 return s2.CompareCodePoints( t1 ) >= 0;
13617 return s2.CompareCodePoints( t1 ) < 0;
13628 return s2.CompareCodePoints( t1 ) <= 0;
13639 return s1.CompareCodePoints( c2 ) == 0;
13650 return s1.CompareCodePoints( c2 ) < 0;
13661 return s1.CompareCodePoints( c2 ) <= 0;
13672 return s1.CompareCodePoints( c2 ) > 0;
13683 return s1.CompareCodePoints( c2 ) >= 0;
13694 return s2.CompareCodePoints( c1 ) == 0;
13705 return s2.CompareCodePoints( c1 ) > 0;
13716 return s2.CompareCodePoints( c1 ) >= 0;
13727 return s2.CompareCodePoints( c1 ) < 0;
13738 return s2.CompareCodePoints( c1 ) <= 0;
13749 return s1.CompareCodePoints( t2 ) == 0;
13760 return s1.CompareCodePoints( t2 ) < 0;
13771 return s1.CompareCodePoints( t2 ) <= 0;
13782 return s1.CompareCodePoints( t2 ) > 0;
13793 return s1.CompareCodePoints( t2 ) >= 0;
13804 return s2.CompareCodePoints( t1 ) == 0;
13815 return s2.CompareCodePoints( t1 ) > 0;
13826 return s2.CompareCodePoints( t1 ) >= 0;
13837 return s2.CompareCodePoints( t1 ) < 0;
13848 return s2.CompareCodePoints( t1 ) <= 0;
13859 return s1.CompareCodePoints( c2 ) == 0;
13870 return s1.CompareCodePoints( c2 ) < 0;
13881 return s1.CompareCodePoints( c2 ) <= 0;
13892 return s1.CompareCodePoints( c2 ) > 0;
13903 return s1.CompareCodePoints( c2 ) >= 0;
13914 return s2.CompareCodePoints( c1 ) == 0;
13925 return s2.CompareCodePoints( c1 ) > 0;
13936 return s2.CompareCodePoints( c1 ) >= 0;
13947 return s2.CompareCodePoints( c1 ) < 0;
13958 return s2.CompareCodePoints( c1 ) <= 0;
13963 #ifndef __PCL_NO_STRING_OSTREAM
13965 inline std::wostream&
operator <<( std::wostream& o,
const String& s )
13967 #ifdef __PCL_WINDOWS
13968 return o << reinterpret_cast<const wchar_t*>( s.c_str() );
13970 Array<wchar_t> w = s.ToWCharArray();
13971 return o << w.Begin();
13975 inline std::ostream&
operator <<( std::ostream& o,
const String& s )
13977 return o << s.ToUTF8();
Provides memory allocation for PCL containers.
bool IsEmpty() const noexcept
A template instantiation of GenericCharTraits for char16_type.
static size_type Length(const char_type *__restrict__ s) noexcept
constexpr T Imag() const noexcept
constexpr T Real() const noexcept
Root base class of all PCL containers of objects.
A type-safe collection of enumerated flags.
static constexpr char_type LF() noexcept
static constexpr char_type Colon() noexcept
static constexpr char_type Null() noexcept
static constexpr char_type Hyphen() noexcept
static constexpr char_type Blank() noexcept
static constexpr char_type Comma() noexcept
static constexpr char_type Tab() noexcept
Generic character string.
size_type FindFirstIC(const_c_string t, size_type i=0) const noexcept
void Append(const_c_string t)
int CompareIC(const_c_string t, bool localeAware=true) const noexcept
void JustifyCenter(size_type width, char_type fill=R::Blank())
int CompareCodePoints(const GenericString< T, R1, A1 > &s, bool caseSensitive=true) const noexcept
static size_type DeleteFreeList()
void Transfer(GenericString &s)
bool WildMatch(const GenericString< T, R1, A1 > &pattern, bool caseSensitive=true) const noexcept
bool ContainsIC(const_c_string t) const noexcept
size_type FindFirst(const_c_string t, size_type i=0) const noexcept
reverse_iterator ReverseBegin()
const_iterator begin() const noexcept
size_type Find(const GenericString< T, R1, A1 > &s, size_type i=0) const noexcept
void ReplaceString(const GenericString< T, R1, A1 > &s1, const GenericString< T, R2, A2 > &s2, size_type i=0)
bool StartsWith(const_c_string t) const noexcept
void Insert(size_type i, const_c_string t, size_type n)
void JustifyRight(size_type width, char_type fill=R::Blank())
void ReplaceChar(char_type c1, char_type c2, size_type i=0, size_type n=maxPos)
bool StartsWithIC(char_type c) const noexcept
void Add(const_c_string t, size_type n)
void Swap(GenericString &s) noexcept
void Insert(size_type i, char_type c, size_type n=1)
GenericString ResizedToNullTerminated() const
size_type BreakIC(C &list, char_type c, bool trim=false, size_type i=0) const
GenericString SetToLength(size_type n) const
void DeleteLeft(size_type i)
void EnsureDoubleQuoted()
bool EndsWithIC(char_type c) const noexcept
void c_copy(iterator dst, size_type maxCharsToCopy, size_type i=0) const noexcept
GenericString Left(size_type n) const
void Prepend(const GenericString< T, R1, A1 > &s)
size_type FindIC(const_c_string t, size_type i=0) const noexcept
GenericString(char_type c, size_type n=1)
void Assign(const_iterator i, const_iterator j)
char_type LastChar() const noexcept
size_type FindLast(const_c_string t, size_type r=maxPos) const noexcept
size_type FindIC(const GenericString< T, R1, A1 > &s, size_type i=0) const noexcept
void Assign(const_c_string t, size_type i, size_type n)
GenericString(const_iterator i, const_iterator j)
void Assign(const GenericString &s, size_type i, size_type n)
GenericString Enclosed(char_type c) const
GenericString Suffix(size_type i) const
void Insert(size_type i, const_iterator p, const_iterator q)
void EnsureEnclosed(char_type c)
reverse_iterator ReverseEnd()
size_type FindLast(const GenericString< T, R1, A1 > &s, size_type r=maxPos) const noexcept
const_iterator end() const noexcept
GenericString Lowercase() const
bool Contains(const GenericString< T, R1, A1 > &s) const noexcept
size_type FindFirst(char_type c, size_type i=0) const noexcept
GenericString(std::initializer_list< char_type > l)
void Assign(std::initializer_list< char_type > l)
void Insert(size_type i, const_c_string t)
void Add(char_type c, size_type n=1)
GenericString TrimmedRight() const
void Reserve(size_type n)
GenericString Unquoted() const
bool StartsWith(char_type c) const noexcept
uint64 Hash64(uint64 seed=0) const noexcept
void Assign(const GenericString &s)
void ReplaceStringIC(const GenericString< T, R1, A1 > &s1, const GenericString< T, R2, A2 > &s2, size_type i=0)
bool StartsWithIC(const GenericString< T, R1, A1 > &s) const noexcept
GenericString Uppercase() const
bool ContainsIC(const GenericString< T, R1, A1 > &s) const noexcept
size_type FindLast(char_type c, size_type r=maxPos) const noexcept
GenericString SingleQuoted() const
char_type FirstChar() const noexcept
void Append(const_c_string t, size_type n)
void Assign(const_c_string t)
GenericString Trimmed() const
void Prepend(const_c_string t)
GenericString Sorted() const
size_type IndexAt(const_iterator i) const noexcept
GenericString LeftJustified(size_type width, char_type fill=R::Blank()) const
size_type FindIC(char_type c, size_type i=0) const noexcept
static size_type BytesPerChar() noexcept
void Replace(size_type i, size_type n, const GenericString< T, R1, A1 > &s)
void DeleteCharIC(char_type c, size_type i=0)
GenericString Right(size_type n) const
bool IsValid() const noexcept
GenericString RightJustified(size_type width, char_type fill=R::Blank()) const
bool WildMatch(const_c_string pattern, bool caseSensitive=true) const noexcept
size_type Break(C &list, char_type c, bool trim=false, size_type i=0) const
int Compare(const GenericString< T, R1, A1 > &s, bool caseSensitive=true, bool localeAware=true) const noexcept
bool StartsWith(const GenericString< T, R1, A1 > &s) const noexcept
size_type UpperBound() const noexcept
GenericString Prefix(size_type i) const
const_reverse_iterator ReverseBegin() const noexcept
int CompareCodePoints(const_c_string t, bool caseSensitive=true) const noexcept
int CompareIC(char_type c, bool localeAware=true) const noexcept
GenericString(const GenericString &s)
bool EndsWithIC(const GenericString< T, R1, A1 > &s) const noexcept
bool IsEmpty() const noexcept
bool HasWildcards() const noexcept
bool IsValidIdentifier() const noexcept
const allocator & Allocator() const noexcept
void DeleteRight(size_type i)
bool StartsWithIC(const_c_string t) const noexcept
int CompareCodePoints(char_type c, bool caseSensitive=true) const noexcept
GenericString CenterJustified(size_type width, char_type fill=R::Blank()) const
void Add(const_c_string t)
void Append(const_iterator i, const_iterator j)
void DeleteString(const GenericString< T, R1, A1 > &s, size_type i=0)
void Fill(char_type c, size_type i, size_type n=maxPos)
void Replace(size_type i, size_type n, const_c_string t)
void SetLength(size_type n)
bool WildMatchIC(const GenericString< T, R1, A1 > &pattern) const noexcept
size_type FindFirstIC(char_type c, size_type i=0) const noexcept
GenericString(const_c_string t, size_type i, size_type n)
bool IsAliasOf(const GenericString &s) const noexcept
bool IsNumeral() const noexcept
void Prepend(const_iterator i, const_iterator j)
GenericString Sorted(BP p) const
void DeleteStringIC(const_c_string t, size_type i=0)
void Prepend(char_type c, size_type n=1)
bool IsSymbol() const noexcept
bool EndsWith(char_type c) const noexcept
void SecureFill(char c='\0') noexcept
size_type Break(C &list, const Array< S > &ca, bool trim=false, size_type i=0) const
bool Contains(char_type c) const noexcept
GenericString Reversed() const
void DeleteString(const_c_string t, size_type i=0)
bool WildMatchIC(const_c_string pattern) const noexcept
uint32 Hash32(uint32 seed=0) const noexcept
uint64 Hash(uint64 seed=0) const noexcept
size_type FindLastIC(char_type c, size_type r=maxPos) const noexcept
void Delete(size_type i, size_type n=1)
size_type FindFirstIC(const GenericString< T, R1, A1 > &s, size_type i=0) const noexcept
size_type Size() const noexcept
void DeleteChar(char_type c, size_type i=0)
void DeleteStringIC(const GenericString< T, R1, A1 > &s, size_type i=0)
int CompareIC(const GenericString< T, R1, A1 > &s, bool localeAware=true) const noexcept
GenericString(const_c_string t)
int Compare(const_c_string t, bool caseSensitive=true, bool localeAware=true) const noexcept
const_iterator End() const noexcept
size_type Break(C &list, const GenericString< T, R1, A1 > &s, bool trim=false, size_type i=0) const
void JustifyLeft(size_type width, char_type fill=R::Blank())
void ResizeToNullTerminated()
void Add(const GenericString< T, R1, A1 > &s)
size_type Find(const_c_string t, size_type i=0) const noexcept
size_type LowerBound() const noexcept
void Append(const GenericString< T, R1, A1 > &s)
void Replace(size_type i, size_type n, char_type c, size_type nc=1)
bool Contains(const_c_string t) const noexcept
void ReplaceString(const_c_string t1, const_c_string t2, size_type i=0)
void ReplaceStringIC(const_c_string t1, const_c_string t2, size_type i=0)
void SetAllocator(const allocator &a)
size_type FindFirst(const GenericString< T, R1, A1 > &s, size_type i=0) const noexcept
size_type Capacity() const noexcept
size_type Available() const noexcept
void Prepend(const_c_string t, size_type n)
void ReplaceCharIC(char_type c1, char_type c2, size_type i=0, size_type n=maxPos)
void EnsureSingleQuoted()
bool ContainsIC(char_type c) const noexcept
size_type BreakIC(C &list, const GenericString< T, R1, A1 > &s, bool trim=false, size_type i=0) const
bool EndsWithIC(const_c_string t) const noexcept
size_type Find(char_type c, size_type i=0) const noexcept
size_type Break(C &list, const_c_string s, bool trim=false, size_type i=0) const
void Transfer(GenericString &&s)
GenericString DoubleQuoted() const
size_type FindLastIC(const GenericString< T, R1, A1 > &s, size_type r=maxPos) const noexcept
void Append(char_type c, size_type n=1)
void Add(const_iterator i, const_iterator j)
const_iterator Begin() const noexcept
bool EndsWith(const_c_string t) const noexcept
bool IsUnique() const noexcept
void Insert(size_type i, const GenericString< T, R1, A1 > &s)
const_iterator At(size_type i) const noexcept
void Assign(char_type c, size_type n=1)
GenericString CaseFolded() const
GenericString Squeezed() const
int Compare(char_type c, bool caseSensitive=true, bool localeAware=true) const noexcept
const_c_string c_str() const noexcept
GenericString Substring(size_type i, size_type n=maxPos) const
const_reverse_iterator ReverseEnd() const noexcept
GenericString TrimmedLeft() const
size_type FindLastIC(const_c_string t, size_type r=maxPos) const noexcept
size_type Length() const noexcept
bool IsValidIdentifier(distance_type &pos) const noexcept
bool EndsWith(const GenericString< T, R1, A1 > &s) const noexcept
GenericString(GenericString &&s)
size_type BreakIC(C &list, const_c_string s, bool trim=false, size_type i=0) const
Generic vector of arbitrary length.
A template instantiation of GenericCharTraits for the char type.
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
IsoString(const ustring_base &s)
IsoString(Complex< float > &x)
IsoString EncodedHTMLSpecialChars() const
IsoString(std::initializer_list< char_type > l)
string_base::const_iterator const_iterator
GenericVector< double > ParseListOfDoubleAsVector(char separator=',', int maxCount=int_max) const
IsoString(const ByteArray &B)
bool TryToInt(int &value, int base) const noexcept
IsoString & ToSeparated(const C &c, char_type separator)
static IsoString ToURLEncoded(const void *data, size_type length)
ustring_base::char_type uchar_type
IsoString & ToURLDecoded()
IsoString & ToCommaSeparated(const C &c)
IsoString & ToHyphenated(const C &c)
int AppendVFormat(const_c_string fmt, va_list paramList)
bool TryToUInt(unsigned &value) const noexcept
IsoString & ToSeparated(const C &c, const_c_string separator)
IsoString & ToSeparated(const C &c, char_type separator, AF append)
IsoString URLDecoded() const
string_base::iterator iterator
bool TryToInt64(long long &value, int base) const noexcept
ByteArray FromBase64() const
IsoString(unsigned long x)
IsoString(const string_base &s)
static IsoString ToBase64URL(const void *data, size_type length)
ByteArray FromHex() const
bool TryToInt64(long long &value) const noexcept
IsoString(unsigned long long x)
static ByteArray FromURLEncoded(const C &c)
IsoString(const IsoString &)=default
unsigned long long ToUInt64(int base) const
bool TryToDouble(double &value) const noexcept
ustring_base::const_c_string const_c_ustring
IsoString & ToEncodedHTMLSpecialChars()
void ParseISO8601DateTime(int &year, int &month, int &day, double &dayf, double &tz) const
IsoString(IsoString &&)=default
IsoString & ToColonSeparated(const C &c)
bool TryToInt(int &value) const noexcept
unsigned long long ToUInt64() const
IsoString & ToSpaceSeparated(const C &c)
IsoString DecodedHTMLSpecialChars() const
static IsoString ToURLDecoded(const C &c)
IsoString & ToNewLineSeparated(const C &c)
long ToInt(int base) const
static IsoString ToURLEncoded(const C &c)
IsoString & ToSeparated(const C &c, const_c_string separator, AF append)
IsoString(Complex< long double > &x)
long long ToInt64() const
static IsoString ToBase64(const void *data, size_type length)
IsoString & ToTabSeparated(const C &c)
IsoString(unsigned int x)
bool TryToUInt64(unsigned long long &value) const noexcept
IsoString(Complex< double > &x)
IsoString(string_base &&s)
unsigned long ToUInt(int base) const
IsoString & ToDecodedHTMLSpecialChars()
IsoString(char_type c, size_type n=1)
ByteArray ToByteArray() const
static IsoString ToHex(const C &c)
ByteArray FromBase64URL() const
IsoString(const_c_ustring t)
IsoString & AppendFormat(const_c_string fmt,...)
ustring_base::c_string c_ustring
static IsoString ToHex(const void *data, size_type length)
GenericVector< float > ParseListOfFloatAsVector(char separator=',', int maxCount=int_max) const
IsoString & ToSeparated(const C &c, const IsoString &separator)
static IsoString ToBase64URL(const C &c)
IsoString & ToSeparated(const C &c, const IsoString &separator, AF append)
static IsoString Random(size_type n, RandomizationOptions options=RandomizationOption::Default)
IsoString & Format(const_c_string fmt,...)
ustring_base MBSToWCS() const
static ByteArray FromURLEncoded(const void *data, size_type length)
Array< double > ParseListOfDouble(char separator=',', size_type maxCount=~size_type(0)) const
string_base::block_allocator block_allocator
IsoString(const_iterator i, const_iterator j)
string_base::char_type char_type
static IsoString CurrentLocalISO8601DateTime(const ISO8601ConversionOptions &options=ISO8601ConversionOptions())
string_base::const_c_string const_c_string
IsoString & ToURLEncoded()
IsoString(unsigned short x)
static IsoString CurrentUTCISO8601DateTime(const ISO8601ConversionOptions &options=ISO8601ConversionOptions())
bool TryParseISO8601DateTime(int &year, int &month, int &day, double &dayf, double &tz) const noexcept
ustring_base UTF8ToUTF16(size_type i=0, size_type n=maxPos) const
IsoString(const_c_string t)
string_base::c_string c_string
IsoString & ToNullSeparated(const C &c)
IsoString & operator=(const IsoString &s)
static IsoString ToURLDecoded(const void *data, size_type length)
static IsoString ToISO8601DateTime(int year, int month, int day, double dayf, double tz=0, const ISO8601ConversionOptions &options=ISO8601ConversionOptions())
unsigned long ToUInt() const
IsoString URLEncoded() const
ustring_base::const_iterator const_uchar_iterator
ByteArray FromURLEncoded() const
int VFormat(const_c_string fmt, va_list paramList)
Array< float > ParseListOfFloat(char separator=',', size_type maxCount=~size_type(0)) const
ustring_base::iterator uchar_iterator
bool TryToBool(bool &value) const noexcept
bool TryToFloat(float &value) const noexcept
bool TryToUInt64(unsigned long long &value, int base) const noexcept
long long ToInt64(int base) const
static IsoString ToBase64(const C &c)
IsoString(const_c_string t, size_type i, size_type n)
ustring_base ToString() const
bool TryToUInt(unsigned &value, int base) const noexcept
A collection of string randomization options.
Reverse random access iterator.
String & ToNewLineSeparated(const C &c)
String & ToSeparated(const C &c, const String &separator)
String(const_char8_iterator i, const_char8_iterator j)
String(Complex< long double > &x)
static IsoString UTF16ToUTF8(const_c_string string, size_type i=0, size_type n=maxPos)
static String CurrentUTCISO8601DateTime(const ISO8601ConversionOptions &options=ISO8601ConversionOptions())
bool TryToInt64(long long &value, int base) const noexcept
GenericVector< double > ParseListOfDoubleAsVector(char separator=',', int maxCount=int_max) const
static String CurrentLocalISO8601DateTime(const ISO8601ConversionOptions &options=ISO8601ConversionOptions())
bool TryToInt(int &value, int base) const noexcept
void Assign(const String &s, size_type i, size_type n)
void Assign(std::initializer_list< char_type > l)
void Assign(const_iterator i, const_iterator j)
IsoString ToLocal8Bit() const
string_base::char_type char_type
String & ToSeparated(const C &c, char_type separator)
int AppendVFormat(const_c_string8 fmt, va_list paramList)
static String UTF32ToUTF16(const uint32 *string, size_type i=0, size_type n=maxPos)
String & ToSeparated(const C &c, char_type separator, AF append)
Array< uint32 > ToUTF32(size_type i=0, size_type n=maxPos) const
void ParseISO8601DateTime(int &year, int &month, int &day, double &dayf, double &tz) const
string8_base::const_c_string const_c_string8
string_base::block_allocator block_allocator
String & AppendFormat(const wchar_t *fmt,...)
Array< wchar_t > ToWCharArray(size_type i=0, size_type n=maxPos) const
String & ToSpaceSeparated(const C &c)
string_base::iterator iterator
String DecodedHTMLSpecialChars() const
String(const wchar_t *t, size_type i, size_type n)
long long ToInt64() const
String & Format(const wchar_t *fmt,...)
String(std::initializer_list< char_type > l)
String(const_c_string8 t, size_type i, size_type n)
String(String &&)=default
String & ToSeparated(const C &c, const_c_string8 separator)
String(std::initializer_list< char8_type > l)
void Assign(const_char8_iterator p, const_char8_iterator q)
GenericVector< float > ParseListOfFloatAsVector(char separator=',', int maxCount=int_max) const
bool TryToUInt64(unsigned long long &value) const noexcept
String(Complex< double > &x)
string8_base::c_string c_string8
String(const_c_string8 t)
void Assign(std::initializer_list< char8_type > l)
void Assign(const wchar_t *t, size_type i, size_type n)
bool TryToFloat(float &value) const noexcept
void Assign(const string8_base &s)
String & ToSeparated(const C &c, const String &separator, AF append)
String(char_type c, size_type n)
String(const string_base &s)
void Assign(const_c_string8 t, size_type i, size_type n)
String & ToSeparated(const C &c, const_c_string separator)
String(char8_type c, size_type n=1)
void Assign(const_iterator t, size_type i, size_type n)
String(const String &)=default
string8_base::const_iterator const_char8_iterator
string_base::const_iterator const_iterator
IsoString ToIsoString() const
void Assign(const char16_t *t, size_type i, size_type n)
String & AppendFormat(const_c_string8 fmt,...)
void Assign(char_type c, size_type n=1)
bool TryParseISO8601DateTime(int &year, int &month, int &day, double &dayf, double &tz) const noexcept
bool TryToUInt(unsigned &value, int base) const noexcept
static Array< uint32 > UTF16ToUTF32(const_c_string string, size_type i=0, size_type n=maxPos)
String & Format(const_c_string8 fmt,...)
String & ToNullSeparated(const C &c)
String(Complex< float > &x)
String(const string8_base &s)
Array< float > ParseListOfFloat(char separator=',', size_type maxCount=~size_type(0)) const
void Assign(char16_t c, size_type n=1)
bool TryToInt64(long long &value) const noexcept
long ToInt(int base) const
bool TryToUInt(unsigned &value) const noexcept
bool TryToInt(int &value) const noexcept
void Assign(const_iterator t)
void Assign(char8_type c, size_type n=1)
unsigned long ToUInt() const
String & ToSeparated(const C &c, const_c_string separator, AF append)
string8_base::char_type char8_type
void Assign(const char16_t *t)
String(const_iterator i, const_iterator j)
String & ToHyphenated(const C &c)
void Assign(wchar_t c, size_type n=1)
string8_base::iterator char8_iterator
long long ToInt64(int base) const
static String Random(size_type n, RandomizationOptions options=RandomizationOption::Default)
void Assign(const wchar_t *t)
String(const char16_t *t, size_type i, size_type n)
int VFormat(const wchar_t *fmt, va_list paramList)
String & ToCommaSeparated(const C &c)
int VFormat(const_c_string8 fmt, va_list paramList)
static String ToISO8601DateTime(int year, int month, int day, double dayf, double tz=0, const ISO8601ConversionOptions &options=ISO8601ConversionOptions())
String(unsigned long long x)
String & ToColonSeparated(const C &c)
String(const char16_t *t)
void Assign(const_c_string8 t)
string_base::c_string c_string
string_base::const_c_string const_c_string
String(char16_t c, size_type n)
void Assign(const String &s)
bool TryToUInt64(unsigned long long &value, int base) const noexcept
GenericString< char16_type, CharTraits, PCL_STRING_ALLOCATOR > string_base
bool TryToDouble(double &value) const noexcept
String EncodedHTMLSpecialChars() const
unsigned long long ToUInt64(int base) const
String(const_iterator t, size_type i, size_type n)
String(wchar_t c, size_type n)
String & ToSeparated(const C &c, const_c_string8 separator, AF append)
int AppendVFormat(const wchar_t *fmt, va_list paramList)
String & ToEncodedHTMLSpecialChars()
String & ToTabSeparated(const C &c)
String & ToDecodedHTMLSpecialChars()
IsoString ToUTF8(size_type i=0, size_type n=maxPos) const
unsigned long long ToUInt64() const
static String UTF8ToUTF16(const_c_string8 string, size_type i=0, size_type n=maxPos)
Array< double > ParseListOfDouble(char separator=',', size_type maxCount=~size_type(0)) const
bool TryToBool(bool &value) const noexcept
unsigned long ToUInt(int base) const
IsoString To7BitASCII() const
Array< T, A > & operator<<(Array< T, A > &x, const V &v)
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
bool operator<(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
Complex< T1 > operator*(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Complex< T1 > operator+(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
T Abs(const Complex< T > &c) noexcept
bool operator<=(const T1 &a, const T2 &b)
bool operator>=(const T1 &a, const T2 &b)
bool operator>(const T1 &a, const T2 &b)
uint64 Hash64(const void *data, size_type size, uint64 seed=0) noexcept
uint32 Hash32(const void *data, size_type size, uint32 seed=0) noexcept
void Swap(GenericPoint< T > &p1, GenericPoint< T > &p2) noexcept
unsigned long long uint64
double SexagesimalToDouble(const IsoString &separator=':') const
bool TryParseSexagesimal(int &sign, int &s1, int &s2, double &s3, const String &separator=':') const noexcept
bool TrySexagesimalToDouble(double &value, const Array< char_type > &separators) const noexcept
static IsoString ToSexagesimal(double d, const SexagesimalConversionOptions &options=SexagesimalConversionOptions())
void ParseSexagesimal(int &sign, int &s1, int &s2, double &s3, const Array< char_type > &separators) const
double SexagesimalToDouble(const Array< char_type > &separators) const
bool TryParseSexagesimal(int &sign, int &s1, int &s2, double &s3, const IsoString &separator=':') const noexcept
double SexagesimalToDouble(const String &separator=':') const
void ParseSexagesimal(int &sign, int &s1, int &s2, double &s3, const Array< char_type > &separators) const
bool TrySexagesimalToDouble(double &value, const Array< char_type > &separators) const noexcept
bool TryParseSexagesimal(int &sign, int &s1, int &s2, double &s3, const Array< char_type > &separators) const noexcept
static IsoString ToSexagesimal(int sign, double s1, double s2, double s3, const SexagesimalConversionOptions &options=SexagesimalConversionOptions())
double SexagesimalToDouble(const Array< char_type > &separators) const
bool TrySexagesimalToDouble(double &value, const String &separator=':') const noexcept
void ParseSexagesimal(int &sign, int &s1, int &s2, double &s3, const String &separator=':') const
bool TrySexagesimalToDouble(double &value, const IsoString &separator=':') const noexcept
void ParseSexagesimal(int &sign, int &s1, int &s2, double &s3, const IsoString &separator=':') const
constexpr const T & Min(const T &a, const T &b) noexcept
int Compare(FI1 i1, FI1 j1, FI2 i2, FI2 j2) noexcept
constexpr const T & Max(const T &a, const T &b) noexcept
A set of options specific for string representations of angles.
constexpr AngleConversionOptions(unsigned precision=2, unsigned width=3, char padding=' ')
A set of options specific for string representations of declination angles.
constexpr DecConversionOptions(unsigned precision=2, unsigned width=3, char padding=' ')
Formatting options for string representations of dates and times in ISO 8601 format....
constexpr ISO8601ConversionOptionsNoTimeZone(unsigned timeItems_=3, unsigned precision_=3)
Formatting options for string representations of dates and times in ISO 8601 format.
ISO8601ConversionOptions(const ISO8601ConversionOptions &)=default
constexpr ISO8601ConversionOptions(unsigned timeItems_=3, unsigned precision_=3, bool timeZone_=true, bool zuluTime_=true)
A set of options specific for string representations of latitude angles.
constexpr LatitudeConversionOptions(unsigned precision=2, unsigned width=3, char padding=' ')
A set of options specific for string representations of longitude angles.
constexpr LongitudeConversionOptions(unsigned precision=2, unsigned width=4, char padding=' ')
A set of options specific for string representations of right ascensions.
constexpr RAConversionOptions(unsigned precision=3, unsigned width=2, char padding=' ')
Formatting options for string sexagesimal representations.
constexpr SexagesimalConversionOptions(unsigned items_=3, unsigned precision_=2, bool sign_=false, unsigned width_=0, char separator_=':', char padding_=' ')
SexagesimalConversionOptions(const SexagesimalConversionOptions &)=default