14template<
typename TChar>
16 TChar* start= &array[0];
17 TChar* end = &array[length-1];
18 while( start < end ) {
26template<
typename TChar>
28 const TChar* needles,
integer needlesLength ) {
30 if ( needlesLength == -1 ) needlesLength=
integer(
Length( needles ) );
32 const TChar* end= haystack + length;
34 const TChar* s= haystack;
36 for(
integer i= 0; i < needlesLength ; ++i )
37 if( *(needles + i) == *s )
45template<
typename TChar>
47 const TChar* needles,
integer needlesLength ) {
49 if ( needlesLength == -1 ) needlesLength=
integer(
Length( needles ) );
51 const TChar* end= haystack + length;
52 const TChar* s = haystack - 1;
55 for( i= 0; i < needlesLength ; ++i )
56 if( needles[i] == *s )
58 if ( i == needlesLength )
65template<
typename TChar>
67 const TChar* needles,
integer needlesLength ) {
68 if ( needlesLength == -1 ) needlesLength=
integer(
Length( needles ) );
70 const TChar* s= haystack + startPos;
71 while( s >= haystack ) {
73 for(
integer i= 0; i < needlesLength ; ++i )
74 if( *(needles + i) == *s )
82template<typename TChar>
84 const TChar* needles,
integer needlesLength ) {
85 if ( needlesLength == -1 ) needlesLength=
integer(
Length( needles ) );
87 const TChar* s= haystack + startPos;
88 while( s >= haystack ) {
92 for( i= 0; i < needlesLength ; ++i )
93 if( needles[i] == *s )
95 if ( i == needlesLength )
103template<
typename TChar>
105 const TChar* needle,
integer needleLength,
107 if ( haystackLength == -1 ) haystackLength=
integer(
Length( haystack ) );
108 if ( needleLength == -1 ) needleLength=
integer(
Length( needle ) );
113 while( idx != haystackLength
114 && idx != needleLength
115 && haystack[idx] == needle[idx] )
118 while( idx != haystackLength
119 && idx != needleLength
142#if !ALIB_CHARACTERS_NATIVE_WCHAR
145 wchar* end= dest + length;
152 const wchar* end= str1 + cmpLength;
155 if( ( diff=
int( towupper(wint_t(*str1++)))
156 -
int( towupper(wint_t(*str2++))) ) != 0 )
163 const wchar* h= haystack;
166 const wchar* n= needles;
180 const wchar* h= haystack;
183 const wchar* n= needles;
216#if ALIB_CHARACTERS_NATIVE_WCHAR
218 xchar* end= dest + length;
224 const xchar* end= str1 + cmpLength;
227 if( ( diff=
int( towupper(wint_t(*str1++)))
228 -
int( towupper(wint_t(*str2++))) ) != 0 )
234 const xchar* h= haystack;
236 const xchar* n= needles;
248 const xchar* h= haystack;
250 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.
strings::TFill< character > Fill
Type alias in namespace #"%alib".
lang::integer integer
Type alias in namespace #"%alib".