Files
easy7zip/CPP/7zip/Compress/PpmdZip.h
Igor Pavlov a36c48cece 23.01
2023-12-22 17:17:05 +00:00

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