1 // ZipRegistry.h 2 3 #ifndef __ZIP_REGISTRY_H 4 #define __ZIP_REGISTRY_H 5 6 #include "../../../Common/MyTypes.h" 7 #include "../../../Common/MyString.h" 8 9 #include "../../Common/MethodProps.h" 10 11 #include "ExtractMode.h" 12 13 /* 14 CBoolPair::Def in writing functions means: 15 if ( CBoolPair::Def ), we write CBoolPair::Val 16 if ( !CBoolPair::Def ) 17 { 18 in NCompression functions we delete registry value 19 in another functions we do nothing 20 } 21 */ 22 23 namespace NExtract 24 { 25 struct CInfo 26 { 27 NPathMode::EEnum PathMode; 28 NOverwriteMode::EEnum OverwriteMode; 29 bool PathMode_Force; 30 bool OverwriteMode_Force; 31 32 CBoolPair SplitDest; 33 CBoolPair ElimDup; 34 // CBoolPair AltStreams; 35 CBoolPair NtSecurity; 36 CBoolPair ShowPassword; 37 38 UStringVector Paths; 39 40 void Save() const; 41 void Load(); 42 }; 43 44 void Save_ShowPassword(bool showPassword); 45 bool Read_ShowPassword(); 46 } 47 48 namespace NCompression 49 { 50 struct CMemUse 51 { 52 // UString Str; 53 bool IsDefined; 54 bool IsPercent; 55 UInt64 Val; 56 CMemUseCMemUse57 CMemUse(): 58 IsDefined(false), 59 IsPercent(false), 60 Val(0) 61 {} 62 ClearCMemUse63 void Clear() 64 { 65 // Str.Empty(); 66 IsDefined = false; 67 IsPercent = false; 68 Val = 0; 69 } 70 GetBytesCMemUse71 UInt64 GetBytes(UInt64 ramSize) const 72 { 73 if (!IsPercent) 74 return Val; 75 return Calc_From_Val_Percents(ramSize, Val); 76 } 77 void Parse(const UString &s); 78 }; 79 80 struct CFormatOptions 81 { 82 UInt32 Level; 83 UInt32 Dictionary; 84 UInt32 Order; 85 UInt32 BlockLogSize; 86 UInt32 NumThreads; 87 88 UInt32 TimePrec; 89 CBoolPair MTime; 90 CBoolPair ATime; 91 CBoolPair CTime; 92 CBoolPair SetArcMTime; 93 94 CSysString FormatID; 95 UString Method; 96 UString Options; 97 UString EncryptionMethod; 98 UString MemUse; 99 Reset_TimePrecCFormatOptions100 void Reset_TimePrec() 101 { 102 TimePrec = (UInt32)(Int32)-1; 103 } 104 IsSet_TimePrecCFormatOptions105 bool IsSet_TimePrec() const 106 { 107 return TimePrec != (UInt32)(Int32)-1; 108 } 109 110 Reset_BlockLogSizeCFormatOptions111 void Reset_BlockLogSize() 112 { 113 BlockLogSize = (UInt32)(Int32)-1; 114 } 115 ResetForLevelChangeCFormatOptions116 void ResetForLevelChange() 117 { 118 BlockLogSize = NumThreads = Level = Dictionary = Order = (UInt32)(Int32)-1; 119 Method.Empty(); 120 // Options.Empty(); 121 // EncryptionMethod.Empty(); 122 } CFormatOptionsCFormatOptions123 CFormatOptions() 124 { 125 // TimePrec = 0; 126 Reset_TimePrec(); 127 ResetForLevelChange(); 128 } 129 }; 130 131 struct CInfo 132 { 133 UInt32 Level; 134 bool ShowPassword; 135 bool EncryptHeaders; 136 UString ArcType; 137 UStringVector ArcPaths; 138 139 CObjectVector<CFormatOptions> Formats; 140 141 CBoolPair NtSecurity; 142 CBoolPair AltStreams; 143 CBoolPair HardLinks; 144 CBoolPair SymLinks; 145 146 CBoolPair PreserveATime; 147 148 void Save() const; 149 void Load(); 150 }; 151 } 152 153 namespace NWorkDir 154 { 155 namespace NMode 156 { 157 enum EEnum 158 { 159 kSystem, 160 kCurrent, 161 kSpecified 162 }; 163 } 164 struct CInfo 165 { 166 NMode::EEnum Mode; 167 FString Path; 168 bool ForRemovableOnly; 169 SetForRemovableOnlyDefaultCInfo170 void SetForRemovableOnlyDefault() { ForRemovableOnly = true; } SetDefaultCInfo171 void SetDefault() 172 { 173 Mode = NMode::kSystem; 174 Path.Empty(); 175 SetForRemovableOnlyDefault(); 176 } 177 178 void Save() const; 179 void Load(); 180 }; 181 } 182 183 184 struct CContextMenuInfo 185 { 186 CBoolPair Cascaded; 187 CBoolPair MenuIcons; 188 CBoolPair ElimDup; 189 190 bool Flags_Def; 191 UInt32 Flags; 192 UInt32 WriteZone; 193 194 /* 195 CContextMenuInfo(): 196 Flags_Def(0), 197 WriteZone((UInt32)(Int32)-1), 198 Flags((UInt32)(Int32)-1) 199 {} 200 */ 201 202 void Save() const; 203 void Load(); 204 }; 205 206 #endif 207