summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lzma/CPP/7zip/Archive/7z/7zFolderInStream.h
blob: 6447b25ca74aeb5585a8464b4ad8cfaf8bcce59e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// 7zFolderInStream.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"

namespace NArchive {
namespace N7z {

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;
  UInt32 _attrib;

  unsigned _numFiles;
  const UInt32 *_indexes;

  CMyComPtr<IArchiveUpdateCallback> _updateCallback;

  void ClearFileInfo();
  HRESULT OpenStream();
  HRESULT AddFileInfo(bool isProcessed);
  // HRESULT CloseCrcStream();
public:
  bool Need_MTime;
  bool Need_CTime;
  bool Need_ATime;
  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;

  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;
    FOR_VECTOR (i, Sizes)
      size += Sizes[i];
    return size;
  }
  */

  CFolderInStream():
      Need_MTime(false),
      Need_CTime(false),
      Need_ATime(false),
      Need_Attrib(false)
      // , Need_Crc(true)
      // , Need_FolderCrc(false)
      // , AlignLog(0)
      {}
};

}}

#endif