1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/other-licenses/7zstub/src/7zip/Common/StreamBinder.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,37 @@ 1.4 +// StreamBinder.h 1.5 + 1.6 +#ifndef __STREAMBINDER_H 1.7 +#define __STREAMBINDER_H 1.8 + 1.9 +#include "../IStream.h" 1.10 +#include "../../Windows/Synchronization.h" 1.11 + 1.12 +class CStreamBinder 1.13 +{ 1.14 + NWindows::NSynchronization::CManualResetEvent *_allBytesAreWritenEvent; 1.15 + NWindows::NSynchronization::CManualResetEvent *_thereAreBytesToReadEvent; 1.16 + NWindows::NSynchronization::CManualResetEvent *_readStreamIsClosedEvent; 1.17 + UInt32 _bufferSize; 1.18 + const void *_buffer; 1.19 +public: 1.20 + // bool ReadingWasClosed; 1.21 + UInt64 ProcessedSize; 1.22 + CStreamBinder(): 1.23 + _allBytesAreWritenEvent(NULL), 1.24 + _thereAreBytesToReadEvent(NULL), 1.25 + _readStreamIsClosedEvent(NULL) 1.26 + {} 1.27 + ~CStreamBinder(); 1.28 + void CreateEvents(); 1.29 + 1.30 + void CreateStreams(ISequentialInStream **inStream, 1.31 + ISequentialOutStream **outStream); 1.32 + HRESULT Read(void *data, UInt32 size, UInt32 *processedSize); 1.33 + void CloseRead(); 1.34 + 1.35 + HRESULT Write(const void *data, UInt32 size, UInt32 *processedSize); 1.36 + void CloseWrite(); 1.37 + void ReInit(); 1.38 +}; 1.39 + 1.40 +#endif