• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 ICompressGetInStreamProcessedSize,
17   public CMyUnknownImp
18 {
19   Byte *_buf;
20   CMyComPtr<ISequentialInStream> _inStream;
21 public:
22   UInt64 TotalSize;
23 
CCopyCoder()24   CCopyCoder(): _buf(0), TotalSize(0) {};
25   ~CCopyCoder();
26 
27   MY_UNKNOWN_IMP4(
28       ICompressCoder,
29       ICompressSetInStream,
30       ISequentialInStream,
31       ICompressGetInStreamProcessedSize)
32 
33   STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
34       const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
35   STDMETHOD(SetInStream)(ISequentialInStream *inStream);
36   STDMETHOD(ReleaseInStream)();
37   STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
38   STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
39 };
40 
41 HRESULT CopyStream(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress);
42 HRESULT CopyStream_ExactSize(ISequentialInStream *inStream, ISequentialOutStream *outStream, UInt64 size, ICompressProgressInfo *progress);
43 
44 }
45 
46 #endif
47