Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
722 B

  1. #pragma once
  2. #include <functional>
  3. //---------------------------------------------------------------------------
  4. // String Ignore Case Less Structure
  5. //---------------------------------------------------------------------------
  6. struct StringIgnoreCaseLess :
  7. public std::binary_function<_bstr_t, _bstr_t, bool>
  8. {
  9. bool operator()(const _bstr_t& x, const _bstr_t& y) const
  10. {
  11. bool bLess;
  12. LPCTSTR pszThis = x;
  13. LPCTSTR pszThat = y;
  14. if (pszThis == pszThat)
  15. {
  16. bLess = false;
  17. }
  18. else if (pszThis == NULL)
  19. {
  20. bLess = true;
  21. }
  22. else if (pszThat == NULL)
  23. {
  24. bLess = false;
  25. }
  26. else
  27. {
  28. bLess = _tcsicmp(pszThis, pszThat) < 0;
  29. }
  30. return bLess;
  31. }
  32. };