Home | History | Annotate | Download | only in 7z
      1 // 7zSpecStream.h
      2 
      3 #ifndef __7Z_SPEC_STREAM_H
      4 #define __7Z_SPEC_STREAM_H
      5 
      6 #include "../../../Common/MyCom.h"
      7 
      8 #include "../../ICoder.h"
      9 
     10 class CSequentialInStreamSizeCount2:
     11   public ISequentialInStream,
     12   public ICompressGetSubStreamSize,
     13   public CMyUnknownImp
     14 {
     15   CMyComPtr<ISequentialInStream> _stream;
     16   CMyComPtr<ICompressGetSubStreamSize> _getSubStreamSize;
     17   UInt64 _size;
     18 public:
     19   void Init(ISequentialInStream *stream)
     20   {
     21     _size = 0;
     22     _getSubStreamSize.Release();
     23     _stream = stream;
     24     _stream.QueryInterface(IID_ICompressGetSubStreamSize, &_getSubStreamSize);
     25   }
     26   UInt64 GetSize() const { return _size; }
     27 
     28   MY_UNKNOWN_IMP2(ISequentialInStream, ICompressGetSubStreamSize)
     29 
     30   STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
     31 
     32   STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value);
     33 };
     34 
     35 #endif
     36