8#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
9# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
38template<
typename TChar>
41 TChar* start= &array[0];
42 TChar* end = &array[length-1];
53template<
typename TChar>
55 const TChar* needles,
integer needlesLength )
58 if ( needlesLength == -1 ) needlesLength=
integer(
Length( needles ) );
60 const TChar* end= haystack + length;
62 const TChar* s= haystack;
65 for(
integer i= 0; i < needlesLength ; ++i )
66 if( *(needles + i) == *s )
74template<
typename TChar>
76 const TChar* needles,
integer needlesLength )
79 if ( needlesLength == -1 ) needlesLength=
integer(
Length( needles ) );
81 const TChar* end= haystack + length;
82 const TChar* s = haystack - 1;
86 for( i= 0; i < needlesLength ; ++i )
87 if( needles[i] == *s )
89 if ( i == needlesLength )
96template<
typename TChar>
98 const TChar* needles,
integer needlesLength )
100 if ( needlesLength == -1 ) needlesLength=
integer(
Length( needles ) );
102 const TChar* s= haystack + startPos;
103 while( s >= haystack )
106 for(
integer i= 0; i < needlesLength ; ++i )
107 if( *(needles + i) == *s )
115template<typename TChar>
117 const TChar* needles,
integer needlesLength )
119 if ( needlesLength == -1 ) needlesLength=
integer(
Length( needles ) );
121 const TChar* s= haystack + startPos;
122 while( s >= haystack )
127 for( i= 0; i < needlesLength ; ++i )
128 if( needles[i] == *s )
130 if ( i == needlesLength )
138template<
typename TChar>
140 const TChar* needle,
integer needleLength,
143 if ( haystackLength == -1 ) haystackLength=
integer(
Length( haystack ) );
144 if ( needleLength == -1 ) needleLength=
integer(
Length( needle ) );
150 while( idx != haystackLength
151 && idx != needleLength
152 && haystack[idx] == needle[idx] )
157 while( idx != haystackLength
158 && idx != needleLength
181#if !ALIB_CHARACTERS_NATIVE_WCHAR
184 wchar* end= dest + length;
191 const wchar* end= str1 + cmpLength;
194 if( ( diff=
int( towupper(wint_t(*str1++)))
195 -
int( towupper(wint_t(*str2++))) ) != 0 )
202 const wchar* h= haystack;
205 const wchar* n= needles;
219 const wchar* h= haystack;
222 const wchar* n= needles;
255#if ALIB_CHARACTERS_NATIVE_WCHAR
258 xchar* end= dest + length;
265 const xchar* end= str1 + cmpLength;
268 if( ( diff=
int( towupper(wint_t(*str1++)))
269 -
int( towupper(wint_t(*str2++))) ) != 0 )
276 const xchar* h= haystack;
279 const xchar* n= needles;
293 const xchar* h= haystack;
296 const xchar* n= needles;
#define ALIB_ASSERT_ERROR(cond, domain,...)
integer Length(const TChar *cstring)
integer IndexOfFirstDifference(const TChar *haystack, integer haystackLength, const TChar *needle, integer needleLength, lang::Case sensitivity)
integer LastIndexOfAnyExclude(const TChar *haystack, integer startIdx, const TChar *needles, integer needlesLength)
void Reverse(TChar *src, integer length)
integer LastIndexOfAnyInclude(const TChar *haystack, integer startIdx, const TChar *needles, integer needlesLength)
integer IndexOfAnyIncludedZT(const TChar *haystack, const TChar *needles)
integer IndexOfAnyIncluded(const TChar *haystack, integer haystackLength, const TChar *needles, integer needlesLength)
integer IndexOfAnyExcluded(const TChar *haystack, integer haystackLength, const TChar *needles, integer needlesLength)
integer IndexOfAnyExcludedZT(const TChar *haystack, const TChar *needles)
int CompareIgnoreCase(const TChar *lhs, const TChar *rhs, integer cmpLength)
Case
Denotes upper and lower case character treatment.
lang::integer integer
Type alias in namespace alib.
strings::TFill< character > Fill
Type alias in namespace alib.