xref: /aosp_15_r20/external/lzma/CPP/7zip/Archive/Zip/ZipCompressionMode.h (revision f6dc9357d832569d4d1f5d24eacdb3935a1ae8e6)
1 // CompressionMode.h
2 
3 #ifndef ZIP7_INC_ZIP_COMPRESSION_MODE_H
4 #define ZIP7_INC_ZIP_COMPRESSION_MODE_H
5 
6 #include "../../../Common/MyString.h"
7 
8 #ifndef Z7_ST
9 #include "../../../Windows/System.h"
10 #endif
11 
12 #include "../Common/HandlerOut.h"
13 
14 namespace NArchive {
15 namespace NZip {
16 
17 const CMethodId kMethodId_ZipBase = 0x040100;
18 const CMethodId kMethodId_BZip2   = 0x040202;
19 
20 struct CBaseProps: public CMultiMethodProps
21 {
22   bool IsAesMode;
23   Byte AesKeyMode;
24 
InitCBaseProps25   void Init()
26   {
27     CMultiMethodProps::Init();
28 
29     IsAesMode = false;
30     AesKeyMode = 3;
31   }
32 };
33 
34 struct CCompressionMethodMode: public CBaseProps
35 {
36   CRecordVector<Byte> MethodSequence;
37   AString Password; // _Wipe
38   bool Password_Defined;
39   bool Force_SeqOutMode;
40   bool DataSizeReduce_Defined;
41   UInt64 DataSizeReduce;
42 
IsRealAesModeCCompressionMethodMode43   bool IsRealAesMode() const { return Password_Defined && IsAesMode; }
44 
CCompressionMethodModeCCompressionMethodMode45   CCompressionMethodMode()
46   {
47     Password_Defined = false;
48     Force_SeqOutMode = false;
49     DataSizeReduce_Defined = false;
50     DataSizeReduce = 0;
51   }
52 
53 #ifdef Z7_CPP_IS_SUPPORTED_default
54   CCompressionMethodMode(const CCompressionMethodMode &) = default;
55   CCompressionMethodMode& operator =(const CCompressionMethodMode &) = default;
56 #endif
~CCompressionMethodModeCCompressionMethodMode57   ~CCompressionMethodMode() { Password.Wipe_and_Empty(); }
58 };
59 
60 }}
61 
62 #endif
63