xref: /aosp_15_r20/external/lzma/CPP/7zip/UI/Common/Extract.h (revision f6dc9357d832569d4d1f5d24eacdb3935a1ae8e6)
1 // Extract.h
2 
3 #ifndef ZIP7_INC_EXTRACT_H
4 #define ZIP7_INC_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   CExtractNtOptions NtOptions;
31 
32   FString OutputDir;
33   UString HashDir;
34 
CExtractOptionsBaseCExtractOptionsBase35   CExtractOptionsBase():
36       ExcludeDirItems(false),
37       ExcludeFileItems(false),
38       PathMode_Force(false),
39       OverwriteMode_Force(false),
40       PathMode(NExtract::NPathMode::kFullPaths),
41       OverwriteMode(NExtract::NOverwriteMode::kAsk),
42       ZoneMode(NExtract::NZoneIdMode::kNone)
43       {}
44 };
45 
46 struct CExtractOptions: public CExtractOptionsBase
47 {
48   bool StdInMode;
49   bool StdOutMode;
50   bool YesToAll;
51   bool TestMode;
52 
53   // bool ShowDialog;
54   // bool PasswordEnabled;
55   // UString Password;
56   #ifndef Z7_SFX
57   CObjectVector<CProperty> Properties;
58   #endif
59 
60   /*
61   #ifdef Z7_EXTERNAL_CODECS
62   CCodecs *Codecs;
63   #endif
64   */
65 
CExtractOptionsCExtractOptions66   CExtractOptions():
67       StdInMode(false),
68       StdOutMode(false),
69       YesToAll(false),
70       TestMode(false)
71       {}
72 };
73 
74 struct CDecompressStat
75 {
76   UInt64 NumArchives;
77   UInt64 UnpackSize;
78   UInt64 AltStreams_UnpackSize;
79   UInt64 PackSize;
80   UInt64 NumFolders;
81   UInt64 NumFiles;
82   UInt64 NumAltStreams;
83 
ClearCDecompressStat84   void Clear()
85   {
86     NumArchives = UnpackSize = AltStreams_UnpackSize = PackSize = NumFolders = NumFiles = NumAltStreams = 0;
87   }
88 };
89 
90 HRESULT Extract(
91     // DECL_EXTERNAL_CODECS_LOC_VARS
92     CCodecs *codecs,
93     const CObjectVector<COpenType> &types,
94     const CIntVector &excludedFormats,
95     UStringVector &archivePaths, UStringVector &archivePathsFull,
96     const NWildcard::CCensorNode &wildcardCensor,
97     const CExtractOptions &options,
98     IOpenCallbackUI *openCallback,
99     IExtractCallbackUI *extractCallback,
100     IFolderArchiveExtractCallback *faeCallback,
101     #ifndef Z7_SFX
102     IHashCalc *hash,
103     #endif
104     UString &errorMessage,
105     CDecompressStat &st);
106 
107 #endif
108