xref: /aosp_15_r20/external/lzma/CPP/7zip/Archive/7z/7zDecode.h (revision f6dc9357d832569d4d1f5d24eacdb3935a1ae8e6)
1 // 7zDecode.h
2 
3 #ifndef ZIP7_INC_7Z_DECODE_H
4 #define ZIP7_INC_7Z_DECODE_H
5 
6 #include "../Common/CoderMixer2.h"
7 
8 #include "7zIn.h"
9 
10 namespace NArchive {
11 namespace N7z {
12 
13 struct CBindInfoEx: public NCoderMixer2::CBindInfo
14 {
15   CRecordVector<CMethodId> CoderMethodIDs;
16 
ClearCBindInfoEx17   void Clear()
18   {
19     CBindInfo::Clear();
20     CoderMethodIDs.Clear();
21   }
22 };
23 
24 class CDecoder
25 {
26   bool _bindInfoPrev_Defined;
27   #ifdef USE_MIXER_ST
28   #ifdef USE_MIXER_MT
29     bool _useMixerMT;
30   #endif
31   #endif
32   CBindInfoEx _bindInfoPrev;
33 
34   #ifdef USE_MIXER_ST
35     NCoderMixer2::CMixerST *_mixerST;
36   #endif
37 
38   #ifdef USE_MIXER_MT
39     NCoderMixer2::CMixerMT *_mixerMT;
40   #endif
41 
42   NCoderMixer2::CMixer *_mixer;
43   CMyComPtr<IUnknown> _mixerRef;
44 
45 public:
46 
47   CDecoder(bool useMixerMT);
48 
49   HRESULT Decode(
50       DECL_EXTERNAL_CODECS_LOC_VARS
51       IInStream *inStream,
52       UInt64 startPos,
53       const CFolders &folders, unsigned folderIndex,
54       const UInt64 *unpackSize // if (!unpackSize), then full folder is required
55                                // if (unpackSize), then only *unpackSize bytes from folder are required
56 
57       , ISequentialOutStream *outStream
58       , ICompressProgressInfo *compressProgress
59 
60       , ISequentialInStream **inStreamMainRes
61       , bool &dataAfterEnd_Error
62 
63       Z7_7Z_DECODER_CRYPRO_VARS_DECL
64 
65       #if !defined(Z7_ST)
66       , bool mtMode, UInt32 numThreads, UInt64 memUsage
67       #endif
68       );
69 };
70 
71 }}
72 
73 #endif
74