1 // Compress/CopyCoder.h 2 3 #ifndef __COMPRESS_COPY_CODER_H 4 #define __COMPRESS_COPY_CODER_H 5 6 #include "../../Common/MyCom.h" 7 8 #include "../ICoder.h" 9 10 namespace NCompress { 11 12 class CCopyCoder: 13 public ICompressCoder, 14 public ICompressSetInStream, 15 public ISequentialInStream, 16 public ICompressSetFinishMode, 17 public ICompressGetInStreamProcessedSize, 18 public CMyUnknownImp 19 { 20 Byte *_buf; 21 CMyComPtr<ISequentialInStream> _inStream; 22 public: 23 UInt64 TotalSize; 24 CCopyCoder()25 CCopyCoder(): _buf(0), TotalSize(0) {}; 26 ~CCopyCoder(); 27 28 MY_UNKNOWN_IMP5( 29 ICompressCoder, 30 ICompressSetInStream, 31 ISequentialInStream, 32 ICompressSetFinishMode, 33 ICompressGetInStreamProcessedSize) 34 35 STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream, 36 const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress); 37 STDMETHOD(SetInStream)(ISequentialInStream *inStream); 38 STDMETHOD(ReleaseInStream)(); 39 STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize); 40 STDMETHOD(SetFinishMode)(UInt32 finishMode); 41 STDMETHOD(GetInStreamProcessedSize)(UInt64 *value); 42 }; 43 44 HRESULT CopyStream(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress); 45 HRESULT CopyStream_ExactSize(ISequentialInStream *inStream, ISequentialOutStream *outStream, UInt64 size, ICompressProgressInfo *progress); 46 47 } 48 49 #endif 50