1 // Extract.h 2 3 #ifndef __EXTRACT_H 4 #define __EXTRACT_H 5 6 #include "../../../Windows/FileFind.h" 7 8 #include "../../Archive/IArchive.h" 9 10 #include "ArchiveExtractCallback.h" 11 #include "ArchiveOpenCallback.h" 12 #include "ExtractMode.h" 13 #include "Property.h" 14 15 #include "../Common/LoadCodecs.h" 16 17 struct CExtractOptionsBase 18 { 19 CBoolPair ElimDup; 20 21 bool ExcludeDirItems; 22 bool ExcludeFileItems; 23 24 bool PathMode_Force; 25 bool OverwriteMode_Force; 26 NExtract::NPathMode::EEnum PathMode; 27 NExtract::NOverwriteMode::EEnum OverwriteMode; 28 NExtract::NZoneIdMode::EEnum ZoneMode; 29 30 FString OutputDir; 31 CExtractNtOptions NtOptions; 32 UString HashDir; 33 CExtractOptionsBaseCExtractOptionsBase34 CExtractOptionsBase(): 35 ExcludeDirItems(false), 36 ExcludeFileItems(false), 37 PathMode_Force(false), 38 OverwriteMode_Force(false), 39 PathMode(NExtract::NPathMode::kFullPaths), 40 OverwriteMode(NExtract::NOverwriteMode::kAsk), 41 ZoneMode(NExtract::NZoneIdMode::kNone) 42 {} 43 }; 44 45 struct CExtractOptions: public CExtractOptionsBase 46 { 47 bool StdInMode; 48 bool StdOutMode; 49 bool YesToAll; 50 bool TestMode; 51 52 // bool ShowDialog; 53 // bool PasswordEnabled; 54 // UString Password; 55 #ifndef _SFX 56 CObjectVector<CProperty> Properties; 57 #endif 58 59 /* 60 #ifdef EXTERNAL_CODECS 61 CCodecs *Codecs; 62 #endif 63 */ 64 CExtractOptionsCExtractOptions65 CExtractOptions(): 66 StdInMode(false), 67 StdOutMode(false), 68 YesToAll(false), 69 TestMode(false) 70 {} 71 }; 72 73 struct CDecompressStat 74 { 75 UInt64 NumArchives; 76 UInt64 UnpackSize; 77 UInt64 AltStreams_UnpackSize; 78 UInt64 PackSize; 79 UInt64 NumFolders; 80 UInt64 NumFiles; 81 UInt64 NumAltStreams; 82 ClearCDecompressStat83 void Clear() 84 { 85 NumArchives = UnpackSize = AltStreams_UnpackSize = PackSize = NumFolders = NumFiles = NumAltStreams = 0; 86 } 87 }; 88 89 HRESULT Extract( 90 // DECL_EXTERNAL_CODECS_LOC_VARS 91 CCodecs *codecs, 92 const CObjectVector<COpenType> &types, 93 const CIntVector &excludedFormats, 94 UStringVector &archivePaths, UStringVector &archivePathsFull, 95 const NWildcard::CCensorNode &wildcardCensor, 96 const CExtractOptions &options, 97 IOpenCallbackUI *openCallback, 98 IExtractCallbackUI *extractCallback, 99 #ifndef _SFX 100 IHashCalc *hash, 101 #endif 102 UString &errorMessage, 103 CDecompressStat &st); 104 105 #endif 106