WindowsXP-SP1/admin/admt/command/less.h
2020-09-30 16:53:49 +02:00

41 lines
722 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;
}
};