windows-nt/Source/XPSP1/NT/admin/admt/command/less.h

41 lines
682 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
#pragma once
#include <functional>
//---------------------------------------------------------------------------
// String Ignore Case Less Structure
//---------------------------------------------------------------------------
struct StringIgnoreCaseLess :
public std::binary_function<_bstr_t, _bstr_t, bool>
{
bool operator()(const _bstr_t& x, const _bstr_t& y) const
{
bool bLess;
LPCTSTR pszThis = x;
LPCTSTR pszThat = y;
if (pszThis == pszThat)
{
bLess = false;
}
else if (pszThis == NULL)
{
bLess = true;
}
else if (pszThat == NULL)
{
bLess = false;
}
else
{
bLess = _tcsicmp(pszThis, pszThat) < 0;
}
return bLess;
}
};