Mercurial > vba-linux
comparison 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 |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
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 |