1370b324cSopenharmony_ci// Extract.h 2370b324cSopenharmony_ci 3370b324cSopenharmony_ci#ifndef ZIP7_INC_EXTRACT_H 4370b324cSopenharmony_ci#define ZIP7_INC_EXTRACT_H 5370b324cSopenharmony_ci 6370b324cSopenharmony_ci#include "../../../Windows/FileFind.h" 7370b324cSopenharmony_ci 8370b324cSopenharmony_ci#include "../../Archive/IArchive.h" 9370b324cSopenharmony_ci 10370b324cSopenharmony_ci#include "ArchiveExtractCallback.h" 11370b324cSopenharmony_ci#include "ArchiveOpenCallback.h" 12370b324cSopenharmony_ci#include "ExtractMode.h" 13370b324cSopenharmony_ci#include "Property.h" 14370b324cSopenharmony_ci 15370b324cSopenharmony_ci#include "../Common/LoadCodecs.h" 16370b324cSopenharmony_ci 17370b324cSopenharmony_cistruct CExtractOptionsBase 18370b324cSopenharmony_ci{ 19370b324cSopenharmony_ci CBoolPair ElimDup; 20370b324cSopenharmony_ci 21370b324cSopenharmony_ci bool ExcludeDirItems; 22370b324cSopenharmony_ci bool ExcludeFileItems; 23370b324cSopenharmony_ci 24370b324cSopenharmony_ci bool PathMode_Force; 25370b324cSopenharmony_ci bool OverwriteMode_Force; 26370b324cSopenharmony_ci NExtract::NPathMode::EEnum PathMode; 27370b324cSopenharmony_ci NExtract::NOverwriteMode::EEnum OverwriteMode; 28370b324cSopenharmony_ci NExtract::NZoneIdMode::EEnum ZoneMode; 29370b324cSopenharmony_ci 30370b324cSopenharmony_ci FString OutputDir; 31370b324cSopenharmony_ci CExtractNtOptions NtOptions; 32370b324cSopenharmony_ci UString HashDir; 33370b324cSopenharmony_ci 34370b324cSopenharmony_ci CExtractOptionsBase(): 35370b324cSopenharmony_ci ExcludeDirItems(false), 36370b324cSopenharmony_ci ExcludeFileItems(false), 37370b324cSopenharmony_ci PathMode_Force(false), 38370b324cSopenharmony_ci OverwriteMode_Force(false), 39370b324cSopenharmony_ci PathMode(NExtract::NPathMode::kFullPaths), 40370b324cSopenharmony_ci OverwriteMode(NExtract::NOverwriteMode::kAsk), 41370b324cSopenharmony_ci ZoneMode(NExtract::NZoneIdMode::kNone) 42370b324cSopenharmony_ci {} 43370b324cSopenharmony_ci}; 44370b324cSopenharmony_ci 45370b324cSopenharmony_cistruct CExtractOptions: public CExtractOptionsBase 46370b324cSopenharmony_ci{ 47370b324cSopenharmony_ci bool StdInMode; 48370b324cSopenharmony_ci bool StdOutMode; 49370b324cSopenharmony_ci bool YesToAll; 50370b324cSopenharmony_ci bool TestMode; 51370b324cSopenharmony_ci 52370b324cSopenharmony_ci // bool ShowDialog; 53370b324cSopenharmony_ci // bool PasswordEnabled; 54370b324cSopenharmony_ci // UString Password; 55370b324cSopenharmony_ci #ifndef Z7_SFX 56370b324cSopenharmony_ci CObjectVector<CProperty> Properties; 57370b324cSopenharmony_ci #endif 58370b324cSopenharmony_ci 59370b324cSopenharmony_ci /* 60370b324cSopenharmony_ci #ifdef Z7_EXTERNAL_CODECS 61370b324cSopenharmony_ci CCodecs *Codecs; 62370b324cSopenharmony_ci #endif 63370b324cSopenharmony_ci */ 64370b324cSopenharmony_ci 65370b324cSopenharmony_ci CExtractOptions(): 66370b324cSopenharmony_ci StdInMode(false), 67370b324cSopenharmony_ci StdOutMode(false), 68370b324cSopenharmony_ci YesToAll(false), 69370b324cSopenharmony_ci TestMode(false) 70370b324cSopenharmony_ci {} 71370b324cSopenharmony_ci}; 72370b324cSopenharmony_ci 73370b324cSopenharmony_cistruct CDecompressStat 74370b324cSopenharmony_ci{ 75370b324cSopenharmony_ci UInt64 NumArchives; 76370b324cSopenharmony_ci UInt64 UnpackSize; 77370b324cSopenharmony_ci UInt64 AltStreams_UnpackSize; 78370b324cSopenharmony_ci UInt64 PackSize; 79370b324cSopenharmony_ci UInt64 NumFolders; 80370b324cSopenharmony_ci UInt64 NumFiles; 81370b324cSopenharmony_ci UInt64 NumAltStreams; 82370b324cSopenharmony_ci 83370b324cSopenharmony_ci void Clear() 84370b324cSopenharmony_ci { 85370b324cSopenharmony_ci NumArchives = UnpackSize = AltStreams_UnpackSize = PackSize = NumFolders = NumFiles = NumAltStreams = 0; 86370b324cSopenharmony_ci } 87370b324cSopenharmony_ci}; 88370b324cSopenharmony_ci 89370b324cSopenharmony_ciHRESULT Extract( 90370b324cSopenharmony_ci // DECL_EXTERNAL_CODECS_LOC_VARS 91370b324cSopenharmony_ci CCodecs *codecs, 92370b324cSopenharmony_ci const CObjectVector<COpenType> &types, 93370b324cSopenharmony_ci const CIntVector &excludedFormats, 94370b324cSopenharmony_ci UStringVector &archivePaths, UStringVector &archivePathsFull, 95370b324cSopenharmony_ci const NWildcard::CCensorNode &wildcardCensor, 96370b324cSopenharmony_ci const CExtractOptions &options, 97370b324cSopenharmony_ci IOpenCallbackUI *openCallback, 98370b324cSopenharmony_ci IExtractCallbackUI *extractCallback, 99370b324cSopenharmony_ci IFolderArchiveExtractCallback *faeCallback, 100370b324cSopenharmony_ci #ifndef Z7_SFX 101370b324cSopenharmony_ci IHashCalc *hash, 102370b324cSopenharmony_ci #endif 103370b324cSopenharmony_ci UString &errorMessage, 104370b324cSopenharmony_ci CDecompressStat &st); 105370b324cSopenharmony_ci 106370b324cSopenharmony_ci#endif 107