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.

66 lines
1.8 KiB

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