1
0

extract.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef _RAR_EXTRACT_
  2. #define _RAR_EXTRACT_
  3. enum EXTRACT_ARC_CODE {EXTRACT_ARC_NEXT,EXTRACT_ARC_REPEAT};
  4. class CmdExtract
  5. {
  6. private:
  7. EXTRACT_ARC_CODE ExtractArchive();
  8. bool ExtractFileCopy(File &New,wchar *ArcName,wchar *NameNew,wchar *NameExisting,size_t NameExistingSize);
  9. void ExtrPrepareName(Archive &Arc,const wchar *ArcFileName,wchar *DestName,size_t DestSize);
  10. #ifdef RARDLL
  11. bool ExtrDllGetPassword();
  12. #else
  13. bool ExtrGetPassword(Archive &Arc,const wchar *ArcFileName);
  14. #endif
  15. #if defined(_WIN_ALL) && !defined(SFX_MODULE)
  16. void ConvertDosPassword(Archive &Arc,SecPassword &DestPwd);
  17. #endif
  18. void ExtrCreateDir(Archive &Arc,const wchar *ArcFileName);
  19. bool ExtrCreateFile(Archive &Arc,File &CurFile);
  20. bool CheckUnpVer(Archive &Arc,const wchar *ArcFileName);
  21. #ifndef SFX_MODULE
  22. bool DetectStartVolume(const wchar *VolName,bool NewNumbering);
  23. void GetFirstVolIfFullSet(const wchar *SrcName,bool NewNumbering,wchar *DestName,size_t DestSize);
  24. #endif
  25. RarTime StartTime; // Time when extraction started.
  26. CommandData *Cmd;
  27. ComprDataIO DataIO;
  28. Unpack *Unp;
  29. unsigned long TotalFileCount;
  30. unsigned long FileCount;
  31. unsigned long MatchedArgs;
  32. bool FirstFile;
  33. bool AllMatchesExact;
  34. bool ReconstructDone;
  35. bool UseExactVolName;
  36. // If any non-zero solid file was successfully unpacked before current.
  37. // If true and if current encrypted file is broken, obviously
  38. // the password is correct and we can report broken CRC without
  39. // any wrong password hints.
  40. bool AnySolidDataUnpackedWell;
  41. wchar ArcName[NM];
  42. bool GlobalPassword;
  43. bool PrevProcessed; // If previous file was successfully extracted or tested.
  44. wchar DestFileName[NM];
  45. bool PasswordCancelled;
  46. #if defined(_WIN_ALL) && !defined(SFX_MODULE) && !defined(SILENT)
  47. bool Fat32,NotFat32;
  48. #endif
  49. public:
  50. CmdExtract(CommandData *Cmd);
  51. ~CmdExtract();
  52. void DoExtract();
  53. void ExtractArchiveInit(Archive &Arc);
  54. bool ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat);
  55. static void UnstoreFile(ComprDataIO &DataIO,int64 DestUnpSize);
  56. };
  57. #endif