Source code of Windows XP (NT5)
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.

74 lines
1.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995.
  5. //
  6. // File: RowComp.hxx
  7. //
  8. // Contents: Compares two rows.
  9. //
  10. // Classes: CRowComparator
  11. //
  12. // History: 05-Jun-95 KyleP Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <compare.hxx>
  17. //+---------------------------------------------------------------------------
  18. //
  19. // Class: CRowComparator
  20. //
  21. // Purpose: Compares two rows.
  22. //
  23. // History: 05-Jun-95 KyleP Created.
  24. //
  25. //----------------------------------------------------------------------------
  26. class CRowComparator
  27. {
  28. public:
  29. CRowComparator();
  30. ~CRowComparator();
  31. unsigned Init( CSort const & sort,
  32. DBBINDING * aBinding,
  33. DBCOLUMNINFO const * aColumnInfo,
  34. DBORDINAL cColumnInfo );
  35. BOOL IsLT( BYTE * pbRow1,
  36. ULONG cbRow1,
  37. int IndexRow1,
  38. BYTE * pbRow2,
  39. ULONG cbRow2,
  40. int IndexRow2 );
  41. private:
  42. //
  43. // Holds length and status codes for sort columns. Used in buffer
  44. // managed by row cache.
  45. //
  46. struct SColumnStatus
  47. {
  48. DBROWSTATUS Status;
  49. DBLENGTH Length;
  50. };
  51. unsigned * _aoColumn; // Offset of each column in _pbRow1, _pbRow2.
  52. //
  53. // Comparison fields.
  54. //
  55. unsigned _cColumn; // Count of columns.
  56. FDBCmp * _aCmp; // Comparators. One per column.
  57. int * _aDir; // 1 for ascending, -1 for descending.
  58. };