Imported Upstream version 9.20
[platform/upstream/7zip.git] / CPP / 7zip / Common / StreamBinder.h
1 // StreamBinder.h\r
2 \r
3 #ifndef __STREAMBINDER_H\r
4 #define __STREAMBINDER_H\r
5 \r
6 #include "../IStream.h"\r
7 #include "../../Windows/Synchronization.h"\r
8 \r
9 class CStreamBinder\r
10 {\r
11   NWindows::NSynchronization::CManualResetEvent _allBytesAreWritenEvent;\r
12   NWindows::NSynchronization::CManualResetEvent _thereAreBytesToReadEvent;\r
13   NWindows::NSynchronization::CManualResetEvent _readStreamIsClosedEvent;\r
14   UInt32 _bufferSize;\r
15   const void *_buffer;\r
16 public:\r
17   // bool ReadingWasClosed;\r
18   UInt64 ProcessedSize;\r
19   CStreamBinder() {}\r
20   HRes CreateEvents();\r
21 \r
22   void CreateStreams(ISequentialInStream **inStream,\r
23       ISequentialOutStream **outStream);\r
24   HRESULT Read(void *data, UInt32 size, UInt32 *processedSize);\r
25   void CloseRead();\r
26 \r
27   HRESULT Write(const void *data, UInt32 size, UInt32 *processedSize);\r
28   void CloseWrite();\r
29   void ReInit();\r
30 };\r
31 \r
32 #endif\r