Mercurial > vba-linux
diff src/win32/7zip/7z/CPP/7zip/Archive/Common/MultiStream.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/Archive/Common/MultiStream.h Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,76 @@ 1.4 +// MultiStream.h 1.5 + 1.6 +#ifndef __MULTISTREAM_H 1.7 +#define __MULTISTREAM_H 1.8 + 1.9 +#include "../../../Common/MyCom.h" 1.10 +#include "../../../Common/MyVector.h" 1.11 +#include "../../Archive/IArchive.h" 1.12 + 1.13 +class CMultiStream: 1.14 + public IInStream, 1.15 + public CMyUnknownImp 1.16 +{ 1.17 + int _streamIndex; 1.18 + UInt64 _pos; 1.19 + UInt64 _seekPos; 1.20 + UInt64 _totalLength; 1.21 +public: 1.22 + struct CSubStreamInfo 1.23 + { 1.24 + CMyComPtr<IInStream> Stream; 1.25 + UInt64 Pos; 1.26 + UInt64 Size; 1.27 + }; 1.28 + CObjectVector<CSubStreamInfo> Streams; 1.29 + void Init() 1.30 + { 1.31 + _streamIndex = 0; 1.32 + _pos = 0; 1.33 + _seekPos = 0; 1.34 + _totalLength = 0; 1.35 + for (int i = 0; i < Streams.Size(); i++) 1.36 + _totalLength += Streams[i].Size; 1.37 + } 1.38 + 1.39 + MY_UNKNOWN_IMP1(IInStream) 1.40 + 1.41 + STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize); 1.42 + STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition); 1.43 +}; 1.44 + 1.45 +/* 1.46 +class COutMultiStream: 1.47 + public IOutStream, 1.48 + public CMyUnknownImp 1.49 +{ 1.50 + int _streamIndex; // required stream 1.51 + UInt64 _offsetPos; // offset from start of _streamIndex index 1.52 + UInt64 _absPos; 1.53 + UInt64 _length; 1.54 + 1.55 + struct CSubStreamInfo 1.56 + { 1.57 + CMyComPtr<ISequentialOutStream> Stream; 1.58 + UInt64 Size; 1.59 + UInt64 Pos; 1.60 + }; 1.61 + CObjectVector<CSubStreamInfo> Streams; 1.62 +public: 1.63 + CMyComPtr<IArchiveUpdateCallback2> VolumeCallback; 1.64 + void Init() 1.65 + { 1.66 + _streamIndex = 0; 1.67 + _offsetPos = 0; 1.68 + _absPos = 0; 1.69 + _length = 0; 1.70 + } 1.71 + 1.72 + MY_UNKNOWN_IMP1(IOutStream) 1.73 + 1.74 + STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); 1.75 + STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition); 1.76 +}; 1.77 +*/ 1.78 + 1.79 +#endif