/// This is a helper function...
template<typename _RandomAccessIterator, typename _Tp>
_RandomAccessIterator
__unguarded_partition(_RandomAccessIterator __first,
_RandomAccessIterator __last, const _Tp& __pivot)
{
while (true)
{
while (*__first < __pivot)
++__first;
--__last;
while (__pivot < *__last)
--__last;
if (!(__first < __last))
return __first;
std::iter_swap(__first, __last);
++__first;
}
}
for (
UINT
nGroupIndex
=
0;
nGroupIndex
<
mcUrl
.
m_uNumGroups;
++
nGroupIndex)
{
const CAtlREMatchContext < CAtlRECharTraitsW >:: RECHAR * szStart = 0;
const CAtlREMatchContext < CAtlRECharTraitsW >:: RECHAR * szEnd = 0;
mcUrl . GetMatch( nGroupIndex , & szStart , & szEnd);
ptrdiff_t nLength = szEnd - szStart;
if ( nLength > 0)
{
wprintf( L"%d: \" %.*s \"\n " , nGroupIndex , nLength , szStart);
}
}
{
const CAtlREMatchContext < CAtlRECharTraitsW >:: RECHAR * szStart = 0;
const CAtlREMatchContext < CAtlRECharTraitsW >:: RECHAR * szEnd = 0;
mcUrl . GetMatch( nGroupIndex , & szStart , & szEnd);
ptrdiff_t nLength = szEnd - szStart;
if ( nLength > 0)
{
wprintf( L"%d: \" %.*s \"\n " , nGroupIndex , nLength , szStart);
}
}
for (UINT nGroupIndex = 0; nGroupIndex < mcUrl.m_uNumGroups; ++nGroupIndex)
{
const CAtlREMatchContext<CAtlRECharTraitsW>::RECHAR* szStart = 0;
const CAtlREMatchContext<CAtlRECharTraitsW>::RECHAR* szEnd = 0;
mcUrl.GetMatch(nGroupIndex, &szStart, &szEnd);
ptrdiff_t nLength = szEnd - szStart;
if (nLength > 0)
{
wprintf(L"%d: \"%.*s\"\n", nGroupIndex, nLength, szStart);
}
}
{
const CAtlREMatchContext<CAtlRECharTraitsW>::RECHAR* szStart = 0;
const CAtlREMatchContext<CAtlRECharTraitsW>::RECHAR* szEnd = 0;
mcUrl.GetMatch(nGroupIndex, &szStart, &szEnd);
ptrdiff_t nLength = szEnd - szStart;
if (nLength > 0)
{
wprintf(L"%d: \"%.*s\"\n", nGroupIndex, nLength, szStart);
}
}