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.

92 lines
2.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993 - 1998
  5. //
  6. // File: pdir.hxx
  7. //
  8. // Contents: persistent directory
  9. //
  10. // Classes: PDirectory
  11. //
  12. // History: 08-Jul-93 BartoszM Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. struct BitOffset;
  17. class CKeyBuf;
  18. class CiStorage;
  19. class CKey;
  20. class CMmStreamBuf;
  21. class PStorage;
  22. class PSaveProgressTracker;
  23. //+-------------------------------------------------------------------------
  24. //
  25. // Class: PDirectoryIter
  26. //
  27. // Purpose: Directory leaf iterator
  28. //
  29. // History: 17-Feb-94 KyleP Created
  30. //
  31. //--------------------------------------------------------------------------
  32. class PDirectoryIter
  33. {
  34. public:
  35. virtual ~PDirectoryIter() {};
  36. virtual CKeyBuf const * GetKey() = 0;
  37. virtual BitOffset const * GetOffset() = 0;
  38. virtual unsigned GetIndex() = 0;
  39. virtual BOOL Next() = 0;
  40. };
  41. //+-------------------------------------------------------------------------
  42. //
  43. // Class: PDirectory
  44. //
  45. // Purpose: Directory (B-Tree)
  46. //
  47. // History: 17-Feb-94 KyleP Added header
  48. //
  49. //--------------------------------------------------------------------------
  50. class PDirectory
  51. {
  52. public:
  53. PDirectory() {}
  54. virtual ~PDirectory () {}
  55. virtual void Add ( BitOffset& posKey, const CKeyBuf& key ) = 0;
  56. virtual void Close() = 0;
  57. virtual void Seek ( const CKeyBuf& key, CKeyBuf *pKeyInit, BitOffset& off )=0;
  58. virtual void Seek ( const CKey& key, CKeyBuf *pKeyInit, BitOffset& off )=0;
  59. virtual void SeekNext ( const CKeyBuf& key, CKeyBuf *pKeyInit, BitOffset& off ) = 0;
  60. virtual unsigned CountLeaf() const = 0;
  61. virtual void LokBuildDir(const CKeyBuf & maxKey) = 0;
  62. virtual void LokFlushDir(const CKeyBuf & maxKey) = 0;
  63. virtual void DeleteKeysAfter( const CKeyBuf & key ) = 0;
  64. virtual void MakeBackupCopy( PStorage & dstStorage,
  65. PSaveProgressTracker & progressTracker ) = 0;
  66. #if (CIDBG == 1)
  67. virtual CKeyBuf const & GetLastKey() = 0;
  68. virtual BitOffset const & GetBitOffsetLastAdded() = 0;
  69. virtual void SetBitOffsetLastAdded( ULONG page, ULONG offset ) = 0;
  70. #endif
  71. };