mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-12 12:11:34 -06:00
4.46 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
a145bfc7cf
commit
c574fc0f4b
@@ -23,8 +23,7 @@ class CHandler:
|
||||
public CMyUnknownImp
|
||||
{
|
||||
public:
|
||||
MY_QUERYINTERFACE_BEGIN
|
||||
MY_QUERYINTERFACE_ENTRY(IInArchive)
|
||||
MY_QUERYINTERFACE_BEGIN2(IInArchive)
|
||||
MY_QUERYINTERFACE_ENTRY(IOutArchive)
|
||||
MY_QUERYINTERFACE_ENTRY(ISetProperties)
|
||||
QUERY_ENTRY_ISetCompressCodecsInfo
|
||||
@@ -79,7 +78,8 @@ private:
|
||||
void InitMethodProperties()
|
||||
{
|
||||
m_Method.NumMatchFinderCyclesDefined = false;
|
||||
m_Level = m_Method.NumPasses = m_Method.NumFastBytes = m_Method.NumMatchFinderCycles = 0xFFFFFFFF;
|
||||
m_Level = m_Method.NumPasses = m_Method.NumFastBytes =
|
||||
m_Method.NumMatchFinderCycles = m_Method.Algo = 0xFFFFFFFF;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@ using namespace NTime;
|
||||
namespace NArchive {
|
||||
namespace NGZip {
|
||||
|
||||
static const UInt32 kAlgoX1 = 0;
|
||||
static const UInt32 kAlgoX5 = 1;
|
||||
|
||||
static const UInt32 kNumPassesX1 = 1;
|
||||
static const UInt32 kNumPassesX7 = 3;
|
||||
static const UInt32 kNumPassesX9 = 10;
|
||||
@@ -137,6 +140,10 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
|
||||
m_Method.NumFastBytes = (level >= 9 ? kNumFastBytesX9 :
|
||||
(level >= 7 ? kNumFastBytesX7 :
|
||||
kNumFastBytesX1));
|
||||
if (m_Method.Algo == 0xFFFFFFFF)
|
||||
m_Method.Algo =
|
||||
(level >= 5 ? kAlgoX5 :
|
||||
kAlgoX1);
|
||||
|
||||
return UpdateArchive(
|
||||
EXTERNAL_CODECS_VARS
|
||||
@@ -193,6 +200,12 @@ STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *v
|
||||
m_Method.NumMatchFinderCycles = num;
|
||||
m_Method.NumMatchFinderCyclesDefined = true;
|
||||
}
|
||||
else if (name.Left(1) == L"A")
|
||||
{
|
||||
UInt32 num = kAlgoX5;
|
||||
RINOK(ParsePropValue(name.Mid(1), prop, num));
|
||||
m_Method.Algo = num;
|
||||
}
|
||||
else
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ HRESULT CInArchive::ReadBytes(ISequentialInStream *inStream, void *data, UInt32
|
||||
|
||||
HRESULT CInArchive::ReadByte(ISequentialInStream *inStream, Byte &value, UInt32 &crc)
|
||||
{
|
||||
HRESULT res = ReadBytes(inStream, &value, 1);
|
||||
RINOK(ReadBytes(inStream, &value, 1));
|
||||
crc = CRC_UPDATE_BYTE(crc, value);
|
||||
return res;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInArchive::ReadUInt16(ISequentialInStream *inStream, UInt16 &value, UInt32 &crc)
|
||||
|
||||
@@ -83,12 +83,14 @@ HRESULT UpdateArchive(
|
||||
|
||||
NWindows::NCOM::CPropVariant properties[] =
|
||||
{
|
||||
compressionMethod.Algo,
|
||||
compressionMethod.NumPasses,
|
||||
compressionMethod.NumFastBytes,
|
||||
compressionMethod.NumMatchFinderCycles
|
||||
};
|
||||
PROPID propIDs[] =
|
||||
{
|
||||
NCoderPropID::kAlgorithm,
|
||||
NCoderPropID::kNumPasses,
|
||||
NCoderPropID::kNumFastBytes,
|
||||
NCoderPropID::kMatchFinderCycles
|
||||
|
||||
@@ -17,6 +17,7 @@ struct CCompressionMethodMode
|
||||
{
|
||||
UInt32 NumPasses;
|
||||
UInt32 NumFastBytes;
|
||||
UInt32 Algo;
|
||||
bool NumMatchFinderCyclesDefined;
|
||||
UInt32 NumMatchFinderCycles;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user