1
0

find.hpp 915 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _RAR_FINDDATA_
  2. #define _RAR_FINDDATA_
  3. enum FINDDATA_FLAGS {
  4. FDDF_SECONDDIR=1 // Second encounter of same directory in SCAN_GETDIRSTWICE ScanTree mode.
  5. };
  6. struct FindData
  7. {
  8. wchar Name[NM];
  9. uint64 Size;
  10. uint FileAttr;
  11. bool IsDir;
  12. bool IsLink;
  13. RarTime mtime;
  14. RarTime ctime;
  15. RarTime atime;
  16. #ifdef _WIN_ALL
  17. FILETIME ftCreationTime;
  18. FILETIME ftLastAccessTime;
  19. FILETIME ftLastWriteTime;
  20. #endif
  21. uint Flags;
  22. bool Error;
  23. };
  24. class FindFile
  25. {
  26. private:
  27. #ifdef _WIN_ALL
  28. static HANDLE Win32Find(HANDLE hFind,const wchar *Mask,FindData *fd);
  29. #endif
  30. wchar FindMask[NM];
  31. bool FirstCall;
  32. #ifdef _WIN_ALL
  33. HANDLE hFind;
  34. #else
  35. DIR *dirp;
  36. #endif
  37. public:
  38. FindFile();
  39. ~FindFile();
  40. void SetMask(const wchar *Mask);
  41. bool Next(FindData *fd,bool GetSymLink=false);
  42. static bool FastFind(const wchar *FindMask,FindData *fd,bool GetSymLink=false);
  43. };
  44. #endif