mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-13 04:11:34 -06:00
Update to 7-Zip Version 22.01
See: https://sourceforge.net/p/sevenzip/discussion/45797/thread/c43cbc5f18/
This commit is contained in:
85
CPP/7zip/Archive/HfsHandler.h
Normal file
85
CPP/7zip/Archive/HfsHandler.h
Normal file
@@ -0,0 +1,85 @@
|
||||
// HfsHandler.h
|
||||
|
||||
#ifndef __HFS_HANDLER_H
|
||||
#define __HFS_HANDLER_H
|
||||
|
||||
#include "../../Windows/PropVariant.h"
|
||||
|
||||
#include "../Compress/LzfseDecoder.h"
|
||||
#include "../Compress/ZlibDecoder.h"
|
||||
|
||||
namespace NArchive {
|
||||
namespace NHfs {
|
||||
|
||||
static const UInt32 k_decmpfs_HeaderSize = 16;
|
||||
|
||||
struct CCompressHeader
|
||||
{
|
||||
UInt64 UnpackSize;
|
||||
UInt32 Method;
|
||||
Byte DataPos;
|
||||
bool IsCorrect;
|
||||
bool IsSupported;
|
||||
bool IsResource;
|
||||
|
||||
bool IsMethod_Compressed_Inline() const { return DataPos == k_decmpfs_HeaderSize; }
|
||||
bool IsMethod_Uncompressed_Inline() const { return DataPos == k_decmpfs_HeaderSize + 1; }
|
||||
bool IsMethod_Resource() const { return IsResource; }
|
||||
|
||||
void Parse(const Byte *p, size_t size);
|
||||
|
||||
void Clear()
|
||||
{
|
||||
UnpackSize = 0;
|
||||
Method = 0;
|
||||
DataPos = 0;
|
||||
IsCorrect = false;
|
||||
IsSupported = false;
|
||||
IsResource = false;
|
||||
}
|
||||
|
||||
CCompressHeader() { Clear(); }
|
||||
|
||||
void MethodToProp(NWindows::NCOM::CPropVariant &prop) const;
|
||||
};
|
||||
|
||||
void MethodsMaskToProp(UInt32 methodsMask, NWindows::NCOM::CPropVariant &prop);
|
||||
|
||||
|
||||
class CDecoder
|
||||
{
|
||||
NCompress::NZlib::CDecoder *_zlibDecoderSpec;
|
||||
CMyComPtr<ICompressCoder> _zlibDecoder;
|
||||
|
||||
NCompress::NLzfse::CDecoder *_lzfseDecoderSpec;
|
||||
CMyComPtr<ICompressCoder> _lzfseDecoder;
|
||||
|
||||
CByteBuffer _tableBuf;
|
||||
CByteBuffer _buf;
|
||||
|
||||
HRESULT ExtractResourceFork_ZLIB(
|
||||
ISequentialInStream *inStream, ISequentialOutStream *realOutStream,
|
||||
UInt64 forkSize, UInt64 unpackSize,
|
||||
UInt64 progressStart, IArchiveExtractCallback *extractCallback);
|
||||
|
||||
HRESULT ExtractResourceFork_LZFSE(
|
||||
ISequentialInStream *inStream, ISequentialOutStream *realOutStream,
|
||||
UInt64 forkSize, UInt64 unpackSize,
|
||||
UInt64 progressStart, IArchiveExtractCallback *extractCallback);
|
||||
|
||||
public:
|
||||
|
||||
HRESULT Extract(
|
||||
ISequentialInStream *inStreamFork, ISequentialOutStream *realOutStream,
|
||||
UInt64 forkSize,
|
||||
const CCompressHeader &compressHeader,
|
||||
const CByteBuffer *data,
|
||||
UInt64 progressStart, IArchiveExtractCallback *extractCallback,
|
||||
int &opRes);
|
||||
|
||||
CDecoder();
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user