windows-nt/Source/XPSP1/NT/admin/admt/command/less.h
2020-09-26 16:20:57 +08:00

41 lines
682 B
C++

#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;
}
};