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