This commit is contained in:
Igor Pavlov
2023-12-22 17:17:05 +00:00
committed by Kornel
parent ec44a8a070
commit a36c48cece
954 changed files with 42199 additions and 25482 deletions

View File

@@ -1,12 +1,13 @@
// 7zFolderInStream.h
#ifndef __7Z_FOLDER_IN_STREAM_H
#define __7Z_FOLDER_IN_STREAM_H
#ifndef ZIP7_INC_7Z_FOLDER_IN_STREAM_H
#define ZIP7_INC_7Z_FOLDER_IN_STREAM_H
#include "../../../../C/7zCrc.h"
#include "../../../Common/MyCom.h"
#include "../../../Common/MyVector.h"
// #include "../Common/InStreamWithCRC.h"
#include "../../ICoder.h"
#include "../IArchive.h"
@@ -14,20 +15,26 @@
namespace NArchive {
namespace N7z {
class CFolderInStream:
public ISequentialInStream,
public ICompressGetSubStreamSize,
public CMyUnknownImp
{
Z7_CLASS_IMP_COM_2(
CFolderInStream
, ISequentialInStream
, ICompressGetSubStreamSize
)
/*
Z7_COM7F_IMP(GetNextStream(UInt64 *streamIndex))
Z7_IFACE_COM7_IMP(ICompressInSubStreams)
*/
CMyComPtr<ISequentialInStream> _stream;
UInt64 _totalSize_for_Coder;
UInt64 _pos;
UInt32 _crc;
bool _size_Defined;
bool _times_Defined;
UInt64 _size;
FILETIME _mTime;
FILETIME _cTime;
FILETIME _aTime;
FILETIME _mTime;
UInt32 _attrib;
unsigned _numFiles;
@@ -35,34 +42,40 @@ class CFolderInStream:
CMyComPtr<IArchiveUpdateCallback> _updateCallback;
void ClearFileInfo();
HRESULT OpenStream();
HRESULT AddFileInfo(bool isProcessed);
// HRESULT CloseCrcStream();
public:
CRecordVector<bool> Processed;
CRecordVector<UInt32> CRCs;
CRecordVector<UInt64> Sizes;
CRecordVector<UInt64> CTimes;
CRecordVector<UInt64> ATimes;
CRecordVector<UInt64> MTimes;
CRecordVector<UInt32> Attribs;
CRecordVector<bool> TimesDefined;
bool Need_MTime;
bool Need_CTime;
bool Need_ATime;
bool Need_MTime;
bool Need_Attrib;
// bool Need_Crc;
// bool Need_FolderCrc;
// unsigned AlignLog;
CRecordVector<bool> Processed;
CRecordVector<UInt64> Sizes;
CRecordVector<UInt32> CRCs;
CRecordVector<UInt32> Attribs;
CRecordVector<bool> TimesDefined;
CRecordVector<UInt64> MTimes;
CRecordVector<UInt64> CTimes;
CRecordVector<UInt64> ATimes;
// UInt32 FolderCrc;
// UInt32 GetFolderCrc() const { return CRC_GET_DIGEST(FolderCrc); }
// CSequentialInStreamWithCRC *_crcStream_Spec;
// CMyComPtr<ISequentialInStream> _crcStream;
// CMyComPtr<IArchiveUpdateCallbackArcProp> _reportArcProp;
MY_UNKNOWN_IMP2(ISequentialInStream, ICompressGetSubStreamSize)
STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value);
void Init(IArchiveUpdateCallback *updateCallback, const UInt32 *indexes, unsigned numFiles);
bool WasFinished() const { return Processed.Size() == _numFiles; }
UInt64 Get_TotalSize_for_Coder() const { return _totalSize_for_Coder; }
/*
UInt64 GetFullSize() const
{
UInt64 size = 0;
@@ -70,12 +83,16 @@ public:
size += Sizes[i];
return size;
}
*/
CFolderInStream():
Need_MTime(false),
Need_CTime(false),
Need_ATime(false),
Need_MTime(false),
Need_Attrib(false)
// , Need_Crc(true)
// , Need_FolderCrc(false)
// , AlignLog(0)
{}
};