Extract.h revision baa3858d3f5d128a5c8466b700098109edcad5f2
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
17struct CExtractOptions
18{
19  bool StdInMode;
20  bool StdOutMode;
21  bool YesToAll;
22  bool TestMode;
23  bool CalcCrc;
24  NExtract::NPathMode::EEnum PathMode;
25  NExtract::NOverwriteMode::EEnum OverwriteMode;
26  UString OutputDir;
27
28  // bool ShowDialog;
29  // bool PasswordEnabled;
30  // UString Password;
31  #if !defined(_7ZIP_ST) && !defined(_SFX)
32  CObjectVector<CProperty> Properties;
33  #endif
34
35  #ifdef EXTERNAL_CODECS
36  CCodecs *Codecs;
37  #endif
38
39  CExtractOptions():
40      StdInMode(false),
41      StdOutMode(false),
42      YesToAll(false),
43      TestMode(false),
44      CalcCrc(false),
45      PathMode(NExtract::NPathMode::kFullPathnames),
46      OverwriteMode(NExtract::NOverwriteMode::kAskBefore)
47      {}
48};
49
50struct CDecompressStat
51{
52  UInt64 NumArchives;
53  UInt64 UnpackSize;
54  UInt64 PackSize;
55  UInt64 NumFolders;
56  UInt64 NumFiles;
57  UInt32 CrcSum;
58
59  void Clear()
60  {
61    NumArchives = UnpackSize = PackSize = NumFolders = NumFiles = 0;
62    CrcSum = 0;
63  }
64};
65
66HRESULT DecompressArchives(
67    CCodecs *codecs, const CIntVector &formatIndices,
68    UStringVector &archivePaths, UStringVector &archivePathsFull,
69    const NWildcard::CCensorNode &wildcardCensor,
70    const CExtractOptions &options,
71    IOpenCallbackUI *openCallback,
72    IExtractCallbackUI *extractCallback,
73    UString &errorMessage,
74    CDecompressStat &stat);
75
76#endif
77