diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/win32/7zip/7z/CPP/7zip/Common/StreamBinder.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,32 @@
     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 +  HRes CreateEvents();
    1.24 +
    1.25 +  void CreateStreams(ISequentialInStream **inStream,
    1.26 +      ISequentialOutStream **outStream);
    1.27 +  HRESULT Read(void *data, UInt32 size, UInt32 *processedSize);
    1.28 +  void CloseRead();
    1.29 +
    1.30 +  HRESULT Write(const void *data, UInt32 size, UInt32 *processedSize);
    1.31 +  void CloseWrite();
    1.32 +  void ReInit();
    1.33 +};
    1.34 +
    1.35 +#endif