mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-16 06:11:48 -06:00
3.13
This commit is contained in:
42
7zip/Common/MultiStream.h
Executable file
42
7zip/Common/MultiStream.h
Executable file
@@ -0,0 +1,42 @@
|
||||
// MultiStream.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __MULTISTREAM_H
|
||||
#define __MULTISTREAM_H
|
||||
|
||||
#include "../../Windows/Synchronization.h"
|
||||
#include "../../Common/MyCom.h"
|
||||
#include "../IStream.h"
|
||||
|
||||
class CLockedInStream
|
||||
{
|
||||
CMyComPtr<IInStream> _stream;
|
||||
NWindows::NSynchronization::CCriticalSection _criticalSection;
|
||||
public:
|
||||
void Init(IInStream *stream)
|
||||
{ _stream = stream; }
|
||||
HRESULT Read(UINT64 startPos, void *data, UINT32 size, UINT32 *processedSize);
|
||||
HRESULT ReadPart(UINT64 startPos, void *data, UINT32 size, UINT32 *processedSize);
|
||||
};
|
||||
|
||||
class CLockedSequentialInStreamImp:
|
||||
public ISequentialInStream,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
CLockedInStream *_lockedInStream;
|
||||
UINT64 _pos;
|
||||
public:
|
||||
void Init(CLockedInStream *lockedInStream, UINT64 startPos)
|
||||
{
|
||||
_lockedInStream = lockedInStream;
|
||||
_pos = startPos;
|
||||
}
|
||||
|
||||
MY_UNKNOWN_IMP
|
||||
|
||||
STDMETHOD(Read)(void *data, UINT32 size, UINT32 *processedSize);
|
||||
STDMETHOD(ReadPart)(void *data, UINT32 size, UINT32 *processedSize);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user