mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-12 22:11:35 -06:00
22.00
This commit is contained in:
21
CPP/7zip/Common/LimitedStreams.h
Normal file → Executable file
21
CPP/7zip/Common/LimitedStreams.h
Normal file → Executable file
@@ -101,21 +101,26 @@ public:
|
||||
STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
|
||||
};
|
||||
|
||||
|
||||
|
||||
const UInt64 k_SeekExtent_Phy_Type_ZeroFill = (UInt64)(Int64)-1;
|
||||
|
||||
struct CSeekExtent
|
||||
{
|
||||
UInt64 Phy;
|
||||
UInt64 Virt;
|
||||
UInt64 Phy;
|
||||
|
||||
void SetAs_ZeroFill() { Phy = k_SeekExtent_Phy_Type_ZeroFill; }
|
||||
bool Is_ZeroFill() const { return Phy == k_SeekExtent_Phy_Type_ZeroFill; }
|
||||
};
|
||||
|
||||
class CExtentsStream:
|
||||
public IInStream,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
UInt64 _phyPos;
|
||||
UInt64 _virtPos;
|
||||
bool _needStartSeek;
|
||||
|
||||
HRESULT SeekToPhys() { return Stream->Seek((Int64)_phyPos, STREAM_SEEK_SET, NULL); }
|
||||
UInt64 _phyPos;
|
||||
unsigned _prevExtentIndex;
|
||||
|
||||
public:
|
||||
CMyComPtr<IInStream> Stream;
|
||||
@@ -129,11 +134,13 @@ public:
|
||||
void Init()
|
||||
{
|
||||
_virtPos = 0;
|
||||
_phyPos = 0;
|
||||
_needStartSeek = true;
|
||||
_phyPos = (UInt64)0 - 1; // we need Seek() for Stream
|
||||
_prevExtentIndex = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
class CLimitedSequentialOutStream:
|
||||
public ISequentialOutStream,
|
||||
public CMyUnknownImp
|
||||
|
||||
Reference in New Issue
Block a user