• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // 7zFolderInStream.h
2 
3 #ifndef ZIP7_INC_7Z_FOLDER_IN_STREAM_H
4 #define ZIP7_INC_7Z_FOLDER_IN_STREAM_H
5 
6 #include "../../../../C/7zCrc.h"
7 
8 #include "../../../Common/MyCom.h"
9 #include "../../../Common/MyVector.h"
10 // #include "../Common/InStreamWithCRC.h"
11 
12 #include "../../ICoder.h"
13 #include "../IArchive.h"
14 
15 namespace NArchive {
16 namespace N7z {
17 
18 Z7_CLASS_IMP_COM_2(
19   CFolderInStream
20   , ISequentialInStream
21   , ICompressGetSubStreamSize
22 )
23   /*
24   Z7_COM7F_IMP(GetNextStream(UInt64 *streamIndex))
25   Z7_IFACE_COM7_IMP(ICompressInSubStreams)
26   */
27 
28   CMyComPtr<ISequentialInStream> _stream;
29   UInt64 _totalSize_for_Coder;
30   UInt64 _pos;
31   UInt32 _crc;
32   bool _size_Defined;
33   bool _times_Defined;
34   UInt64 _size;
35   FILETIME _mTime;
36   FILETIME _cTime;
37   FILETIME _aTime;
38   UInt32 _attrib;
39 
40   unsigned _numFiles;
41   const UInt32 *_indexes;
42 
43   CMyComPtr<IArchiveUpdateCallback> _updateCallback;
44 
45   void ClearFileInfo();
46   HRESULT OpenStream();
47   HRESULT AddFileInfo(bool isProcessed);
48   // HRESULT CloseCrcStream();
49 public:
50   bool Need_MTime;
51   bool Need_CTime;
52   bool Need_ATime;
53   bool Need_Attrib;
54   // bool Need_Crc;
55   // bool Need_FolderCrc;
56   // unsigned AlignLog;
57 
58   CRecordVector<bool> Processed;
59   CRecordVector<UInt64> Sizes;
60   CRecordVector<UInt32> CRCs;
61   CRecordVector<UInt32> Attribs;
62   CRecordVector<bool> TimesDefined;
63   CRecordVector<UInt64> MTimes;
64   CRecordVector<UInt64> CTimes;
65   CRecordVector<UInt64> ATimes;
66   // UInt32 FolderCrc;
67 
68   // UInt32 GetFolderCrc() const { return CRC_GET_DIGEST(FolderCrc); }
69   // CSequentialInStreamWithCRC *_crcStream_Spec;
70   // CMyComPtr<ISequentialInStream> _crcStream;
71   // CMyComPtr<IArchiveUpdateCallbackArcProp> _reportArcProp;
72 
73   void Init(IArchiveUpdateCallback *updateCallback, const UInt32 *indexes, unsigned numFiles);
74 
WasFinished()75   bool WasFinished() const { return Processed.Size() == _numFiles; }
76 
Get_TotalSize_for_Coder()77   UInt64 Get_TotalSize_for_Coder() const { return _totalSize_for_Coder; }
78   /*
79   UInt64 GetFullSize() const
80   {
81     UInt64 size = 0;
82     FOR_VECTOR (i, Sizes)
83       size += Sizes[i];
84     return size;
85   }
86   */
87 
CFolderInStream()88   CFolderInStream():
89       Need_MTime(false),
90       Need_CTime(false),
91       Need_ATime(false),
92       Need_Attrib(false)
93       // , Need_Crc(true)
94       // , Need_FolderCrc(false)
95       // , AlignLog(0)
96       {}
97 };
98 
99 }}
100 
101 #endif
102