Mercurial > vba-linux
comparison src/win32/7zip/7z/CPP/7zip/Common/LockedStream.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
1 // LockedStream.h | |
2 | |
3 #ifndef __LOCKEDSTREAM_H | |
4 #define __LOCKEDSTREAM_H | |
5 | |
6 #include "../../Windows/Synchronization.h" | |
7 #include "../../Common/MyCom.h" | |
8 #include "../IStream.h" | |
9 | |
10 class CLockedInStream | |
11 { | |
12 CMyComPtr<IInStream> _stream; | |
13 NWindows::NSynchronization::CCriticalSection _criticalSection; | |
14 public: | |
15 void Init(IInStream *stream) | |
16 { _stream = stream; } | |
17 HRESULT Read(UInt64 startPos, void *data, UInt32 size, UInt32 *processedSize); | |
18 }; | |
19 | |
20 class CLockedSequentialInStreamImp: | |
21 public ISequentialInStream, | |
22 public CMyUnknownImp | |
23 { | |
24 CLockedInStream *_lockedInStream; | |
25 UInt64 _pos; | |
26 public: | |
27 void Init(CLockedInStream *lockedInStream, UInt64 startPos) | |
28 { | |
29 _lockedInStream = lockedInStream; | |
30 _pos = startPos; | |
31 } | |
32 | |
33 MY_UNKNOWN_IMP | |
34 | |
35 STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize); | |
36 }; | |
37 | |
38 #endif |