10#if !defined(HPP_ALIB_CHARACTERS_CHARARRAY)
30template<
typename TChar>
33 TChar* start= &array[0];
34 TChar* end = &array[length-1];
45template<
typename TChar>
47 const TChar* needles,
integer needlesLength )
49 if ( length == -1 ) length=
static_cast<integer>( Length( haystack ) );
50 if ( needlesLength == -1 ) needlesLength=
static_cast<integer>( Length( needles ) );
52 const TChar* end= haystack + length;
54 const TChar* s= haystack;
57 for(
integer i= 0; i < needlesLength ; ++i )
58 if( *(needles + i) == *s )
66template<
typename TChar>
68 const TChar* needles,
integer needlesLength )
70 if ( length == -1 ) length=
static_cast<integer>( Length( haystack ) );
71 if ( needlesLength == -1 ) needlesLength=
static_cast<integer>( Length( needles ) );
73 const TChar* end= haystack + length;
74 const TChar* s = haystack - 1;
78 for( i= 0; i < needlesLength ; ++i )
79 if( needles[i] == *s )
81 if ( i == needlesLength )
88template<
typename TChar>
90 const TChar* needles,
integer needlesLength )
92 if ( needlesLength == -1 ) needlesLength=
static_cast<integer>( Length( needles ) );
94 const TChar* s= haystack + startPos;
95 while( s >= haystack )
98 for(
integer i= 0; i < needlesLength ; ++i )
99 if( *(needles + i) == *s )
107template<typename TChar>
108integer CharArray<TChar>::LastIndexOfAnyExclude( const TChar* haystack,
integer startPos,
109 const TChar* needles,
integer needlesLength )
111 if ( needlesLength == -1 ) needlesLength=
static_cast<integer>( Length( needles ) );
113 const TChar* s= haystack + startPos;
114 while( s >= haystack )
119 for( i= 0; i < needlesLength ; ++i )
120 if( needles[i] == *s )
122 if ( i == needlesLength )
130template<
typename TChar>
132 const TChar* needle,
integer needleLength,
135 if ( haystackLength == -1 ) haystackLength=
static_cast<integer>( Length( haystack ) );
136 if ( needleLength == -1 ) needleLength=
static_cast<integer>( Length( needle ) );
142 while( idx != haystackLength
143 && idx != needleLength
144 && haystack[idx] == needle[idx] )
149 while( idx != haystackLength
150 && idx != needleLength
151 && ToUpper( haystack[idx] )
152 == ToUpper( needle[idx] ) )
173#if !ALIB_CHARACTERS_NATIVE_WCHAR
176 wchar* end= dest + length;
183 const wchar* end= str1 + cmpLength;
186 if( ( diff=
static_cast<int>( towupper(
static_cast<wint_t
>(*str1++)))
187 -
static_cast<int>( towupper(
static_cast<wint_t
>(*str2++))) ) != 0 )
194 const wchar* h= haystack;
197 const wchar* n= needles;
211 const wchar* h= haystack;
214 const wchar* n= needles;
247#if ALIB_CHARACTERS_NATIVE_WCHAR
250 xchar* end= dest + length;
257 const xchar* end= str1 + cmpLength;
260 if( ( diff=
static_cast<int>( towupper(
static_cast<wint_t
>(*str1++)))
261 -
static_cast<int>( towupper(
static_cast<wint_t
>(*str2++))) ) != 0 )
268 const xchar* h= haystack;
271 const xchar* n= needles;
285 const xchar* h= haystack;
288 const xchar* n= needles;
315#if defined(ALIB_GDB_PP_SUPPRESS_CHILDREN)
316 extern int ALIB_PRETTY_PRINTERS_SUPPRESS_CHILDREN;
317 int ALIB_PRETTY_PRINTERS_SUPPRESS_CHILDREN;
320#if defined(ALIB_GDB_PP_FIND_POINTER_TYPES)
321 extern int ALIB_PRETTY_PRINTERS_FIND_POINTER_TYPES;
322 int ALIB_PRETTY_PRINTERS_FIND_POINTER_TYPES;
329#if ALIB_CHARACTERS_WIDE
330 extern int ALIB_PRETTY_PRINTERS_DEFAULT_CHAR_IS_WIDE;
331 int ALIB_PRETTY_PRINTERS_DEFAULT_CHAR_IS_WIDE;
334#if ALIB_SIZEOF_WCHAR_T == 4
335 extern int ALIB_PRETTY_PRINTERS_WCHAR_SIZE_IS_4;
336 int ALIB_PRETTY_PRINTERS_WCHAR_SIZE_IS_4;
#define ALIB_WARNINGS_RESTORE
#define ALIB_ASSERT_ERROR(cond,...)
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
lang::integer integer
Type alias in namespace alib.
static integer IndexOfFirstDifference(const TChar *haystack, integer haystackLength, const TChar *needle, integer needleLength, lang::Case sensitivity)
static integer LastIndexOfAnyExclude(const TChar *haystack, integer startIdx, const TChar *needles, integer needlesLength)
static integer IndexOfAnyIncludedZT(const TChar *haystack, const TChar *needles)
static integer IndexOfAnyExcludedZT(const TChar *haystack, const TChar *needles)
static ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE void Reverse(TChar *src, integer length)
static void Fill(TChar *dest, integer length, TChar value)
static integer IndexOfAnyExcluded(const TChar *haystack, integer haystackLength, const TChar *needles, integer needlesLength)
static int CompareIgnoreCase(const TChar *lhs, const TChar *rhs, integer cmpLength)
static integer LastIndexOfAnyInclude(const TChar *haystack, integer startIdx, const TChar *needles, integer needlesLength)
static ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE integer IndexOfAnyIncluded(const TChar *haystack, integer haystackLength, const TChar *needles, integer needlesLength)