mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-14 04:11:37 -06:00
9.34
This commit is contained in:
committed by
Kornel Lesiński
parent
83f8ddcc5b
commit
f08f4dcc3c
41
CPP/7zip/Archive/Nsis/NsisDecode.h
Executable file → Normal file
41
CPP/7zip/Archive/Nsis/NsisDecode.h
Executable file → Normal file
@@ -3,9 +3,11 @@
|
||||
#ifndef __NSIS_DECODE_H
|
||||
#define __NSIS_DECODE_H
|
||||
|
||||
#include "../../IStream.h"
|
||||
#include "../../../Common/MyBuffer.h"
|
||||
|
||||
#include "../../Common/CreateCoder.h"
|
||||
#include "../../Common/StreamUtils.h"
|
||||
|
||||
#include "../../Compress/LzmaDecoder.h"
|
||||
|
||||
namespace NArchive {
|
||||
namespace NNsis {
|
||||
@@ -21,25 +23,50 @@ namespace NMethodType
|
||||
};
|
||||
}
|
||||
|
||||
/* 7-Zip installers 4.38 - 9.08 used modified version of NSIS that
|
||||
supported BCJ filter for better compression ratio.
|
||||
We support such modified NSIS archives. */
|
||||
|
||||
class CDecoder
|
||||
{
|
||||
NMethodType::EEnum _method;
|
||||
NMethodType::EEnum _curMethod; // method of created decoder
|
||||
|
||||
CMyComPtr<ISequentialInStream> _filterInStream;
|
||||
CMyComPtr<ISequentialInStream> _codecInStream;
|
||||
CMyComPtr<ISequentialInStream> _decoderInStream;
|
||||
|
||||
NCompress::NLzma::CDecoder *_lzmaDecoder;
|
||||
|
||||
public:
|
||||
CMyComPtr<IInStream> InputStream; // for non-solid
|
||||
UInt64 StreamPos; // the pos in unpacked for solid, the pos in Packed for non-solid
|
||||
|
||||
NMethodType::EEnum Method;
|
||||
bool FilterFlag;
|
||||
bool Solid;
|
||||
|
||||
CByteBuffer Buffer; // temp buf.
|
||||
|
||||
void Release()
|
||||
{
|
||||
_filterInStream.Release();
|
||||
_codecInStream.Release();
|
||||
_decoderInStream.Release();
|
||||
InputStream.Release();
|
||||
_lzmaDecoder = NULL;
|
||||
}
|
||||
HRESULT Init(
|
||||
DECL_EXTERNAL_CODECS_LOC_VARS
|
||||
IInStream *inStream, NMethodType::EEnum method, bool thereIsFilterFlag, bool &useFilter);
|
||||
HRESULT Read(void *data, size_t *processedSize);
|
||||
|
||||
HRESULT Init(ISequentialInStream *inStream, bool &useFilter);
|
||||
HRESULT Read(void *data, size_t *processedSize)
|
||||
{
|
||||
return ReadStream(_decoderInStream, data, processedSize);;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CDecoder::SetToPos(UInt64 pos, ICompressProgressInfo *progress); // for solid
|
||||
HRESULT Decode(CByteBuffer *outBuf, bool unpackSizeDefined, UInt32 unpackSize,
|
||||
ISequentialOutStream *realOutStream, ICompressProgressInfo *progress,
|
||||
UInt32 &packSizeRes, UInt32 &unpackSizeRes);
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user