Extract.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Extract.h
  2. #ifndef __EXTRACT_H
  3. #define __EXTRACT_H
  4. #include "Common/Wildcard.h"
  5. #include "Windows/FileFind.h"
  6. #include "../../Archive/IArchive.h"
  7. #include "ArchiveExtractCallback.h"
  8. #include "ArchiveOpenCallback.h"
  9. #include "ExtractMode.h"
  10. #include "Property.h"
  11. #include "../Common/LoadCodecs.h"
  12. class CExtractOptions
  13. {
  14. public:
  15. bool StdOutMode;
  16. bool TestMode;
  17. NExtract::NPathMode::EEnum PathMode;
  18. UString OutputDir;
  19. bool YesToAll;
  20. UString DefaultItemName;
  21. NWindows::NFile::NFind::CFileInfoW ArchiveFileInfo;
  22. // bool ShowDialog;
  23. // bool PasswordEnabled;
  24. // UString Password;
  25. #ifdef COMPRESS_MT
  26. CObjectVector<CProperty> Properties;
  27. #endif
  28. NExtract::NOverwriteMode::EEnum OverwriteMode;
  29. #ifdef EXTERNAL_CODECS
  30. CCodecs *Codecs;
  31. #endif
  32. CExtractOptions():
  33. StdOutMode(false),
  34. YesToAll(false),
  35. TestMode(false),
  36. PathMode(NExtract::NPathMode::kFullPathnames),
  37. OverwriteMode(NExtract::NOverwriteMode::kAskBefore)
  38. {}
  39. /*
  40. bool FullPathMode() const { return (ExtractMode == NExtractMode::kTest) ||
  41. (ExtractMode == NExtractMode::kFullPath); }
  42. */
  43. };
  44. struct CDecompressStat
  45. {
  46. UInt64 NumArchives;
  47. UInt64 UnpackSize;
  48. UInt64 PackSize;
  49. UInt64 NumFolders;
  50. UInt64 NumFiles;
  51. void Clear() { NumArchives = PackSize = UnpackSize = NumFolders = NumFiles = 0; }
  52. };
  53. HRESULT DecompressArchives(
  54. CCodecs *codecs,
  55. UStringVector &archivePaths, UStringVector &archivePathsFull,
  56. const NWildcard::CCensorNode &wildcardCensor,
  57. const CExtractOptions &options,
  58. IOpenCallbackUI *openCallback,
  59. IExtractCallbackUI *extractCallback,
  60. UString &errorMessage,
  61. CDecompressStat &stat);
  62. #endif