1370b324cSopenharmony_ci// 7zFolderInStream.h 2370b324cSopenharmony_ci 3370b324cSopenharmony_ci#ifndef ZIP7_INC_7Z_FOLDER_IN_STREAM_H 4370b324cSopenharmony_ci#define ZIP7_INC_7Z_FOLDER_IN_STREAM_H 5370b324cSopenharmony_ci 6370b324cSopenharmony_ci#include "../../../../C/7zCrc.h" 7370b324cSopenharmony_ci 8370b324cSopenharmony_ci#include "../../../Common/MyCom.h" 9370b324cSopenharmony_ci#include "../../../Common/MyVector.h" 10370b324cSopenharmony_ci// #include "../Common/InStreamWithCRC.h" 11370b324cSopenharmony_ci 12370b324cSopenharmony_ci#include "../../ICoder.h" 13370b324cSopenharmony_ci#include "../IArchive.h" 14370b324cSopenharmony_ci 15370b324cSopenharmony_cinamespace NArchive { 16370b324cSopenharmony_cinamespace N7z { 17370b324cSopenharmony_ci 18370b324cSopenharmony_ciZ7_CLASS_IMP_COM_2( 19370b324cSopenharmony_ci CFolderInStream 20370b324cSopenharmony_ci , ISequentialInStream 21370b324cSopenharmony_ci , ICompressGetSubStreamSize 22370b324cSopenharmony_ci) 23370b324cSopenharmony_ci /* 24370b324cSopenharmony_ci Z7_COM7F_IMP(GetNextStream(UInt64 *streamIndex)) 25370b324cSopenharmony_ci Z7_IFACE_COM7_IMP(ICompressInSubStreams) 26370b324cSopenharmony_ci */ 27370b324cSopenharmony_ci 28370b324cSopenharmony_ci CMyComPtr<ISequentialInStream> _stream; 29370b324cSopenharmony_ci UInt64 _totalSize_for_Coder; 30370b324cSopenharmony_ci UInt64 _pos; 31370b324cSopenharmony_ci UInt32 _crc; 32370b324cSopenharmony_ci bool _size_Defined; 33370b324cSopenharmony_ci bool _times_Defined; 34370b324cSopenharmony_ci UInt64 _size; 35370b324cSopenharmony_ci FILETIME _mTime; 36370b324cSopenharmony_ci FILETIME _cTime; 37370b324cSopenharmony_ci FILETIME _aTime; 38370b324cSopenharmony_ci UInt32 _attrib; 39370b324cSopenharmony_ci 40370b324cSopenharmony_ci unsigned _numFiles; 41370b324cSopenharmony_ci const UInt32 *_indexes; 42370b324cSopenharmony_ci 43370b324cSopenharmony_ci CMyComPtr<IArchiveUpdateCallback> _updateCallback; 44370b324cSopenharmony_ci 45370b324cSopenharmony_ci void ClearFileInfo(); 46370b324cSopenharmony_ci HRESULT OpenStream(); 47370b324cSopenharmony_ci HRESULT AddFileInfo(bool isProcessed); 48370b324cSopenharmony_ci // HRESULT CloseCrcStream(); 49370b324cSopenharmony_cipublic: 50370b324cSopenharmony_ci bool Need_MTime; 51370b324cSopenharmony_ci bool Need_CTime; 52370b324cSopenharmony_ci bool Need_ATime; 53370b324cSopenharmony_ci bool Need_Attrib; 54370b324cSopenharmony_ci // bool Need_Crc; 55370b324cSopenharmony_ci // bool Need_FolderCrc; 56370b324cSopenharmony_ci // unsigned AlignLog; 57370b324cSopenharmony_ci 58370b324cSopenharmony_ci CRecordVector<bool> Processed; 59370b324cSopenharmony_ci CRecordVector<UInt64> Sizes; 60370b324cSopenharmony_ci CRecordVector<UInt32> CRCs; 61370b324cSopenharmony_ci CRecordVector<UInt32> Attribs; 62370b324cSopenharmony_ci CRecordVector<bool> TimesDefined; 63370b324cSopenharmony_ci CRecordVector<UInt64> MTimes; 64370b324cSopenharmony_ci CRecordVector<UInt64> CTimes; 65370b324cSopenharmony_ci CRecordVector<UInt64> ATimes; 66370b324cSopenharmony_ci // UInt32 FolderCrc; 67370b324cSopenharmony_ci 68370b324cSopenharmony_ci // UInt32 GetFolderCrc() const { return CRC_GET_DIGEST(FolderCrc); } 69370b324cSopenharmony_ci // CSequentialInStreamWithCRC *_crcStream_Spec; 70370b324cSopenharmony_ci // CMyComPtr<ISequentialInStream> _crcStream; 71370b324cSopenharmony_ci // CMyComPtr<IArchiveUpdateCallbackArcProp> _reportArcProp; 72370b324cSopenharmony_ci 73370b324cSopenharmony_ci void Init(IArchiveUpdateCallback *updateCallback, const UInt32 *indexes, unsigned numFiles); 74370b324cSopenharmony_ci 75370b324cSopenharmony_ci bool WasFinished() const { return Processed.Size() == _numFiles; } 76370b324cSopenharmony_ci 77370b324cSopenharmony_ci UInt64 Get_TotalSize_for_Coder() const { return _totalSize_for_Coder; } 78370b324cSopenharmony_ci /* 79370b324cSopenharmony_ci UInt64 GetFullSize() const 80370b324cSopenharmony_ci { 81370b324cSopenharmony_ci UInt64 size = 0; 82370b324cSopenharmony_ci FOR_VECTOR (i, Sizes) 83370b324cSopenharmony_ci size += Sizes[i]; 84370b324cSopenharmony_ci return size; 85370b324cSopenharmony_ci } 86370b324cSopenharmony_ci */ 87370b324cSopenharmony_ci 88370b324cSopenharmony_ci CFolderInStream(): 89370b324cSopenharmony_ci Need_MTime(false), 90370b324cSopenharmony_ci Need_CTime(false), 91370b324cSopenharmony_ci Need_ATime(false), 92370b324cSopenharmony_ci Need_Attrib(false) 93370b324cSopenharmony_ci // , Need_Crc(true) 94370b324cSopenharmony_ci // , Need_FolderCrc(false) 95370b324cSopenharmony_ci // , AlignLog(0) 96370b324cSopenharmony_ci {} 97370b324cSopenharmony_ci}; 98370b324cSopenharmony_ci 99370b324cSopenharmony_ci}} 100370b324cSopenharmony_ci 101370b324cSopenharmony_ci#endif 102