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.

93 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 2000-2001 Microsoft Corporation
  3. Module Name:
  4. direntrs.h
  5. Abstract:
  6. Definition of the directory entries class. Given a path to a directory,
  7. creates two linked lists, one a list of all sub-directories (including
  8. mountpoints) and another a list of non-directories.
  9. Author:
  10. Stefan R. Steiner [ssteiner] 02-21-2000
  11. Revision History:
  12. --*/
  13. #ifndef __H_DIRENTRS_
  14. #define __H_DIRENTRS_
  15. #pragma once
  16. #include "vs_list.h"
  17. //
  18. // The structure filled in per file/dir.
  19. //
  20. //
  21. struct SDirectoryEntry
  22. {
  23. CBsString &GetFileName() { return m_cwsFileName; }
  24. CBsString &GetShortName() { return m_cwsShortName; }
  25. CBsString m_cwsFileName;
  26. CBsString m_cwsShortName;
  27. WIN32_FILE_ATTRIBUTE_DATA m_sFindData;
  28. };
  29. //
  30. // The linked list iterator type definition
  31. //
  32. typedef CVssDLListIterator< SDirectoryEntry * > CDirectoryEntriesIterator;
  33. //
  34. // Class: CDirectoryEntries
  35. //
  36. class CDirectoryEntries
  37. {
  38. public:
  39. CDirectoryEntries(
  40. IN CDumpParameters *pcDumpParameters,
  41. IN const CBsString& cwsDirPath
  42. );
  43. virtual ~CDirectoryEntries();
  44. CDirectoryEntriesIterator *GetDirListIterator()
  45. {
  46. CVssDLListIterator< SDirectoryEntry * > *pcListIter;
  47. pcListIter = new CDirectoryEntriesIterator( m_cDirList );
  48. if ( pcListIter == NULL ) // fix future prefix bug
  49. throw E_OUTOFMEMORY;
  50. return pcListIter;
  51. }
  52. CDirectoryEntriesIterator *GetFileListIterator()
  53. {
  54. CVssDLListIterator< SDirectoryEntry * > *pcListIter;
  55. pcListIter = new CDirectoryEntriesIterator( m_cFileList );
  56. if ( pcListIter == NULL ) // fix future prefix bug
  57. throw E_OUTOFMEMORY;
  58. return pcListIter;
  59. }
  60. private:
  61. DWORD GetDirectoryEntries();
  62. CBsString m_cwsDirPath;
  63. CVssDLList< SDirectoryEntry * > m_cDirList;
  64. CVssDLList< SDirectoryEntry * > m_cFileList;
  65. CDumpParameters *m_pcParams;
  66. };
  67. #endif // __H_DIRENTRS_