mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 15:14:59 -06:00
86 lines
1.2 KiB
C++
Executable File
86 lines
1.2 KiB
C++
Executable File
// PpmdZip.h
|
|
|
|
#ifndef ZIP7_INC_COMPRESS_PPMD_ZIP_H
|
|
#define ZIP7_INC_COMPRESS_PPMD_ZIP_H
|
|
|
|
#include "../../../C/Alloc.h"
|
|
#include "../../../C/Ppmd8.h"
|
|
|
|
#include "../../Common/MyCom.h"
|
|
|
|
#include "../ICoder.h"
|
|
|
|
#include "../Common/CWrappers.h"
|
|
|
|
namespace NCompress {
|
|
namespace NPpmdZip {
|
|
|
|
static const UInt32 kBufSize = (1 << 20);
|
|
|
|
struct CBuf
|
|
{
|
|
Byte *Buf;
|
|
|
|
CBuf(): Buf(NULL) {}
|
|
~CBuf() { ::MidFree(Buf); }
|
|
bool Alloc()
|
|
{
|
|
if (!Buf)
|
|
Buf = (Byte *)::MidAlloc(kBufSize);
|
|
return (Buf != NULL);
|
|
}
|
|
};
|
|
|
|
|
|
Z7_CLASS_IMP_NOQIB_3(
|
|
CDecoder
|
|
, ICompressCoder
|
|
, ICompressSetFinishMode
|
|
, ICompressGetInStreamProcessedSize
|
|
)
|
|
CByteInBufWrap _inStream;
|
|
CBuf _outStream;
|
|
CPpmd8 _ppmd;
|
|
bool _fullFileMode;
|
|
public:
|
|
CDecoder(bool fullFileMode = true);
|
|
~CDecoder();
|
|
};
|
|
|
|
|
|
struct CEncProps
|
|
{
|
|
UInt32 MemSizeMB;
|
|
UInt32 ReduceSize;
|
|
int Order;
|
|
int Restor;
|
|
|
|
CEncProps()
|
|
{
|
|
MemSizeMB = (UInt32)(Int32)-1;
|
|
ReduceSize = (UInt32)(Int32)-1;
|
|
Order = -1;
|
|
Restor = -1;
|
|
}
|
|
void Normalize(int level);
|
|
};
|
|
|
|
|
|
Z7_CLASS_IMP_NOQIB_2(
|
|
CEncoder
|
|
, ICompressCoder
|
|
, ICompressSetCoderProperties
|
|
)
|
|
CByteOutBufWrap _outStream;
|
|
CBuf _inStream;
|
|
CPpmd8 _ppmd;
|
|
CEncProps _props;
|
|
public:
|
|
CEncoder();
|
|
~CEncoder();
|
|
};
|
|
|
|
}}
|
|
|
|
#endif
|