view src/win32/7zip/7z/CPP/7zip/Common/StreamBinder.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line source
1 // StreamBinder.h
3 #ifndef __STREAMBINDER_H
4 #define __STREAMBINDER_H
6 #include "../IStream.h"
7 #include "../../Windows/Synchronization.h"
9 class CStreamBinder
10 {
11 NWindows::NSynchronization::CManualResetEvent _allBytesAreWritenEvent;
12 NWindows::NSynchronization::CManualResetEvent _thereAreBytesToReadEvent;
13 NWindows::NSynchronization::CManualResetEvent _readStreamIsClosedEvent;
14 UInt32 _bufferSize;
15 const void *_buffer;
16 public:
17 // bool ReadingWasClosed;
18 UInt64 ProcessedSize;
19 CStreamBinder() {}
20 HRes CreateEvents();
22 void CreateStreams(ISequentialInStream **inStream,
23 ISequentialOutStream **outStream);
24 HRESULT Read(void *data, UInt32 size, UInt32 *processedSize);
25 void CloseRead();
27 HRESULT Write(const void *data, UInt32 size, UInt32 *processedSize);
28 void CloseWrite();
29 void ReInit();
30 };
32 #endif