home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sdktools / winnt / cacls / fileenum.hxx < prev    next >
Text File  |  1995-03-13  |  2KB  |  70 lines

  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.  
  17. #include <t2.hxx>
  18.  
  19. class CFileEnumerate;
  20. //+-------------------------------------------------------------------
  21. //
  22. //  Class:      CFileEnumurate
  23. //
  24. //  Purpose:    encapsulation of File enumeration, this class takes
  25. //              a path/filename with wildcards and a depth option,
  26. //              and provides init and next methods to allow iteration
  27. //              thru all the files specfied by the input path/filename and
  28. //              depth option
  29. //
  30. //--------------------------------------------------------------------
  31. class CFileEnumerate
  32. {
  33. public:
  34.  
  35.     CFileEnumerate(BOOL fdeep);
  36.  
  37.    ~CFileEnumerate();
  38.  
  39.     ULONG Init(CHAR *filename, WCHAR **wfilename, BOOL *fdir);
  40.     ULONG Init(WCHAR *filename, WCHAR **wfilename, BOOL *fdir);
  41.  
  42.     ULONG Next(WCHAR **wfilename, BOOL *fdir);
  43.  
  44. private:
  45.  
  46.     ULONG _ialize(WCHAR *winfilename, WCHAR **wfilename, BOOL *fdir);
  47.  
  48.     ULONG _NextLocal(WCHAR **wfilename, BOOL *fdir);
  49.     ULONG _NextDir(WCHAR **wfilename, BOOL *fdir);
  50.     ULONG _InitDir(WCHAR **wfilename, BOOL *fdir);
  51.     ULONG _DownDir(WCHAR **wfilename, BOOL *fdir);
  52.  
  53.     WCHAR            _wpath[MAX_PATH] ;
  54.     WCHAR            _wwildcards[MAX_PATH] ;
  55.     WCHAR          * _pwfileposition ;
  56.     HANDLE           _handle    ;
  57.     WIN32_FIND_DATA  _wfd  ;
  58.     BOOL             _froot;   // root takes special handling
  59.     BOOL             _fdeep;
  60.     BOOL             _findeep;
  61.     BOOL             _fcannotaccess;
  62.     CFileEnumerate * _pcfe ;
  63. };
  64.  
  65. #endif // __FileEnumerate__
  66.  
  67.  
  68.  
  69.  
  70.