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