mirror of
https://github.com/Xevion/easy7zip.git
synced 2026-01-31 12:24:08 -06:00
9.11
This commit is contained in:
committed by
Kornel Lesiński
parent
db5eb6d638
commit
993daef9cb
@@ -1,17 +1,16 @@
|
||||
// PpmdEncoder.h
|
||||
// 2009-05-30 : Igor Pavlov : Public domain
|
||||
// 2009-03-11 : Igor Pavlov : Public domain
|
||||
|
||||
#ifndef __COMPRESS_PPMD_ENCODER_H
|
||||
#define __COMPRESS_PPMD_ENCODER_H
|
||||
|
||||
#include "../../../C/Ppmd7.h"
|
||||
|
||||
#include "../../Common/MyCom.h"
|
||||
|
||||
#include "../ICoder.h"
|
||||
|
||||
#include "../Common/InBuffer.h"
|
||||
|
||||
#include "PpmdEncode.h"
|
||||
#include "RangeCoder.h"
|
||||
#include "../Common/CWrappers.h"
|
||||
|
||||
namespace NCompress {
|
||||
namespace NPpmd {
|
||||
@@ -22,56 +21,26 @@ class CEncoder :
|
||||
public ICompressWriteCoderProperties,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
public:
|
||||
CInBuffer _inStream;
|
||||
Byte *_inBuf;
|
||||
CByteOutBufWrap _outStream;
|
||||
CPpmd7z_RangeEnc _rangeEnc;
|
||||
CPpmd7 _ppmd;
|
||||
|
||||
NRangeCoder::CEncoder _rangeEncoder;
|
||||
|
||||
CEncodeInfo _info;
|
||||
UInt32 _usedMemorySize;
|
||||
UInt32 _usedMemSize;
|
||||
Byte _order;
|
||||
|
||||
HRESULT Flush()
|
||||
{
|
||||
_rangeEncoder.FlushData();
|
||||
return _rangeEncoder.FlushStream();
|
||||
}
|
||||
|
||||
void ReleaseStreams()
|
||||
{
|
||||
_inStream.ReleaseStream();
|
||||
_rangeEncoder.ReleaseStream();
|
||||
}
|
||||
|
||||
HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
|
||||
const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
|
||||
|
||||
class CEncoderFlusher
|
||||
{
|
||||
CEncoder *_encoder;
|
||||
public:
|
||||
CEncoderFlusher(CEncoder *encoder): _encoder(encoder) {}
|
||||
~CEncoderFlusher()
|
||||
{
|
||||
_encoder->Flush();
|
||||
_encoder->ReleaseStreams();
|
||||
}
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MY_UNKNOWN_IMP2(
|
||||
ICompressSetCoderProperties,
|
||||
ICompressWriteCoderProperties)
|
||||
|
||||
STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
|
||||
const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
|
||||
|
||||
STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
|
||||
|
||||
STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
|
||||
|
||||
CEncoder();
|
||||
~CEncoder();
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user