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.

96 lines
2.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1996.
  5. //
  6. // File: msfiter.hxx
  7. //
  8. // Contents: Definitions for iterator objects
  9. //
  10. // Classes: CMSFIterator - Main iterator class for MSF
  11. //
  12. // Functions: None.
  13. //
  14. //--------------------------------------------------------------------------
  15. #ifndef __MSFITER_HXX__
  16. #define __MSFITER_HXX__
  17. #include "msf.hxx"
  18. class CDirectory;
  19. //+-------------------------------------------------------------------------
  20. //
  21. // Class: CMSFIterator
  22. //
  23. // Purpose: Iterator object provided by multi-stream
  24. //
  25. // Interface: See below
  26. //
  27. //--------------------------------------------------------------------------
  28. class CMSFIterator
  29. {
  30. public:
  31. inline CMSFIterator(CDirectory *pdir, SID sidChild);
  32. SCODE GetNext(STATSTGW *pstat);
  33. SCODE BufferGetNext(SIterBuffer *pib);
  34. inline SCODE Rewind(VOID);
  35. inline void Release(VOID);
  36. private:
  37. CDirectory *_pdir;
  38. SID _sidChildRoot;
  39. CDfName _dfnCurrent;
  40. };
  41. inline CMSFIterator::CMSFIterator(CDirectory *pdir, SID sidChild)
  42. {
  43. _pdir = pdir;
  44. _sidChildRoot = sidChild;
  45. }
  46. //+-------------------------------------------------------------------------
  47. //
  48. // Member: CMSFIterator::Rewind, public
  49. //
  50. // Synposis: Reset iterator to first position.
  51. //
  52. // Effects: Modifies _sidCurrent
  53. //
  54. // Arguments: Void.
  55. //
  56. // Returns: S_OK
  57. //
  58. // Notes:
  59. //
  60. //---------------------------------------------------------------------------
  61. inline SCODE CMSFIterator::Rewind(VOID)
  62. {
  63. msfDebugOut((DEB_TRACE,"In CMSFIterator::Rewind()\n"));
  64. _dfnCurrent.Set((WORD)0, (BYTE *)NULL);
  65. msfDebugOut((DEB_TRACE,"Leaving CMSFIterator::Rewind()\n"));
  66. return S_OK;
  67. }
  68. //+-------------------------------------------------------------------------
  69. //
  70. // Method: CMSFIterator::Release, public
  71. //
  72. // Synopsis: Release this MSFIterator instance
  73. //
  74. // Arguments: None.
  75. //
  76. // Returns: Void.
  77. //
  78. //--------------------------------------------------------------------------
  79. inline void CMSFIterator::Release(VOID)
  80. {
  81. delete this;
  82. }
  83. #endif //__MSFITER_HXX__