misc/libphysfs/lzma/CPP/7zip/Archive/Common/MultiStream.h
branchui-scaling
changeset 15283 c4fd2813b127
parent 13390 0135e64c6c66
parent 15279 7ab5cf405686
child 15663 d92eeb468dad
equal deleted inserted replaced
13390:0135e64c6c66 15283:c4fd2813b127
     1 // MultiStream.h
       
     2 
       
     3 #ifndef __MULTISTREAM_H
       
     4 #define __MULTISTREAM_H
       
     5 
       
     6 #include "../../../Common/MyCom.h"
       
     7 #include "../../../Common/MyVector.h"
       
     8 #include "../../Archive/IArchive.h"
       
     9 
       
    10 class CMultiStream: 
       
    11   public IInStream,
       
    12   public CMyUnknownImp
       
    13 {
       
    14   int _streamIndex;
       
    15   UInt64 _pos;
       
    16   UInt64 _seekPos;
       
    17   UInt64 _totalLength;
       
    18 public:
       
    19   struct CSubStreamInfo
       
    20   {
       
    21     CMyComPtr<IInStream> Stream;
       
    22     UInt64 Pos;
       
    23     UInt64 Size;
       
    24   };
       
    25   CObjectVector<CSubStreamInfo> Streams;
       
    26   void Init()
       
    27   {
       
    28     _streamIndex = 0;
       
    29     _pos = 0;
       
    30     _seekPos = 0;
       
    31     _totalLength = 0;
       
    32     for (int i = 0; i < Streams.Size(); i++)
       
    33       _totalLength += Streams[i].Size;
       
    34   }
       
    35 
       
    36   MY_UNKNOWN_IMP1(IInStream)
       
    37 
       
    38   STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
       
    39   STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
       
    40 };
       
    41 
       
    42 /*
       
    43 class COutMultiStream: 
       
    44   public IOutStream,
       
    45   public CMyUnknownImp
       
    46 {
       
    47   int _streamIndex; // required stream
       
    48   UInt64 _offsetPos; // offset from start of _streamIndex index
       
    49   UInt64 _absPos;
       
    50   UInt64 _length;
       
    51 
       
    52   struct CSubStreamInfo
       
    53   {
       
    54     CMyComPtr<ISequentialOutStream> Stream;
       
    55     UInt64 Size;
       
    56     UInt64 Pos;
       
    57  };
       
    58   CObjectVector<CSubStreamInfo> Streams;
       
    59 public:
       
    60   CMyComPtr<IArchiveUpdateCallback2> VolumeCallback;
       
    61   void Init()
       
    62   {
       
    63     _streamIndex = 0;
       
    64     _offsetPos = 0;
       
    65     _absPos = 0;
       
    66     _length = 0;
       
    67   }
       
    68 
       
    69   MY_UNKNOWN_IMP1(IOutStream)
       
    70 
       
    71   STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
       
    72   STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
       
    73 };
       
    74 */
       
    75 
       
    76 #endif