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.

69 lines
1.9 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1995, Microsoft Corporation.
  4. //
  5. // File: FileEnum.hxx
  6. //
  7. // Contents: class encapsulating file enumeration
  8. //
  9. // Classes: CFileEnumurate
  10. //
  11. // History: Nov-93 Created DaveMont
  12. //
  13. //--------------------------------------------------------------------
  14. #ifndef __FileEnumerate__
  15. #define __FileEnumerate__
  16. #include <t2.hxx>
  17. class CFileEnumerate;
  18. //+-------------------------------------------------------------------
  19. //
  20. // Class: CFileEnumurate
  21. //
  22. // Purpose: encapsulation of File enumeration, this class takes
  23. // a path/filename with wildcards and a depth option,
  24. // and provides init and next methods to allow iteration
  25. // thru all the files specfied by the input path/filename and
  26. // depth option
  27. //
  28. //--------------------------------------------------------------------
  29. class CFileEnumerate
  30. {
  31. public:
  32. CFileEnumerate(BOOL fdeep);
  33. ~CFileEnumerate();
  34. ULONG Init(CHAR *filename, WCHAR **wfilename, BOOL *fdir);
  35. ULONG Init(WCHAR *filename, WCHAR **wfilename, BOOL *fdir);
  36. ULONG Next(WCHAR **wfilename, BOOL *fdir);
  37. private:
  38. ULONG _ialize(WCHAR *winfilename, WCHAR **wfilename, BOOL *fdir);
  39. ULONG _NextLocal(WCHAR **wfilename, BOOL *fdir);
  40. ULONG _NextDir(WCHAR **wfilename, BOOL *fdir);
  41. ULONG _InitDir(WCHAR **wfilename, BOOL *fdir);
  42. ULONG _DownDir(WCHAR **wfilename, BOOL *fdir);
  43. WCHAR _wpath[MAX_PATH] ;
  44. WCHAR _wwildcards[MAX_PATH] ;
  45. WCHAR * _pwfileposition ;
  46. HANDLE _handle ;
  47. WIN32_FIND_DATA _wfd ;
  48. BOOL _froot; // root takes special handling
  49. BOOL _fdeep;
  50. BOOL _findeep;
  51. BOOL _fcannotaccess;
  52. CFileEnumerate * _pcfe ;
  53. };
  54. #endif // __FileEnumerate__