Imported Upstream version 9.20
[platform/upstream/7zip.git] / CPP / 7zip / Archive / 7z / 7zUpdate.h
1 // 7zUpdate.h\r
2 \r
3 #ifndef __7Z_UPDATE_H\r
4 #define __7Z_UPDATE_H\r
5 \r
6 #include "7zCompressionMode.h"\r
7 #include "7zIn.h"\r
8 #include "7zOut.h"\r
9 \r
10 #include "../IArchive.h"\r
11 \r
12 namespace NArchive {\r
13 namespace N7z {\r
14 \r
15 struct CUpdateItem\r
16 {\r
17   int IndexInArchive;\r
18   int IndexInClient;\r
19   \r
20   UInt64 CTime;\r
21   UInt64 ATime;\r
22   UInt64 MTime;\r
23 \r
24   UInt64 Size;\r
25   UString Name;\r
26 \r
27   UInt32 Attrib;\r
28   \r
29   bool NewData;\r
30   bool NewProps;\r
31 \r
32   bool IsAnti;\r
33   bool IsDir;\r
34 \r
35   bool AttribDefined;\r
36   bool CTimeDefined;\r
37   bool ATimeDefined;\r
38   bool MTimeDefined;\r
39 \r
40   bool HasStream() const { return !IsDir && !IsAnti && Size != 0; }\r
41 \r
42   CUpdateItem():\r
43       IsAnti(false),\r
44       IsDir(false),\r
45       AttribDefined(false),\r
46       CTimeDefined(false),\r
47       ATimeDefined(false),\r
48       MTimeDefined(false)\r
49       {}\r
50   void SetDirStatusFromAttrib() { IsDir = ((Attrib & FILE_ATTRIBUTE_DIRECTORY) != 0); };\r
51 \r
52   int GetExtensionPos() const;\r
53   UString GetExtension() const;\r
54 };\r
55 \r
56 struct CUpdateOptions\r
57 {\r
58   const CCompressionMethodMode *Method;\r
59   const CCompressionMethodMode *HeaderMethod;\r
60   bool UseFilters;\r
61   bool MaxFilter;\r
62 \r
63   CHeaderOptions HeaderOptions;\r
64 \r
65   UInt64 NumSolidFiles;\r
66   UInt64 NumSolidBytes;\r
67   bool SolidExtension;\r
68   bool RemoveSfxBlock;\r
69   bool VolumeMode;\r
70 };\r
71 \r
72 HRESULT Update(\r
73     DECL_EXTERNAL_CODECS_LOC_VARS\r
74     IInStream *inStream,\r
75     const CArchiveDatabaseEx *db,\r
76     const CObjectVector<CUpdateItem> &updateItems,\r
77     COutArchive &archive,\r
78     CArchiveDatabase &newDatabase,\r
79     ISequentialOutStream *seqOutStream,\r
80     IArchiveUpdateCallback *updateCallback,\r
81     const CUpdateOptions &options\r
82     #ifndef _NO_CRYPTO\r
83     , ICryptoGetTextPassword *getDecoderPassword\r
84     #endif\r
85     );\r
86 }}\r
87 \r
88 #endif\r