1 // ZipRegistry.h 2 3 #ifndef ZIP7_INC_ZIP_REGISTRY_H 4 #define ZIP7_INC_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 void Save_LimitGB(UInt32 limit_GB); 48 UInt32 Read_LimitGB(); 49 } 50 51 namespace NCompression 52 { 53 struct CMemUse 54 { 55 // UString Str; 56 bool IsDefined; 57 bool IsPercent; 58 UInt64 Val; 59 CMemUseCMemUse60 CMemUse(): 61 IsDefined(false), 62 IsPercent(false), 63 Val(0) 64 {} 65 ClearCMemUse66 void Clear() 67 { 68 // Str.Empty(); 69 IsDefined = false; 70 IsPercent = false; 71 Val = 0; 72 } 73 GetBytesCMemUse74 UInt64 GetBytes(UInt64 ramSize) const 75 { 76 if (!IsPercent) 77 return Val; 78 return Calc_From_Val_Percents(ramSize, Val); 79 } 80 void Parse(const UString &s); 81 }; 82 83 struct CFormatOptions 84 { 85 UInt32 Level; 86 UInt32 Dictionary; 87 // UInt32 DictionaryChain; 88 UInt32 Order; 89 UInt32 BlockLogSize; 90 UInt32 NumThreads; 91 92 UInt32 TimePrec; 93 CBoolPair MTime; 94 CBoolPair ATime; 95 CBoolPair CTime; 96 CBoolPair SetArcMTime; 97 98 CSysString FormatID; 99 UString Method; 100 UString Options; 101 UString EncryptionMethod; 102 UString MemUse; 103 Reset_TimePrecCFormatOptions104 void Reset_TimePrec() 105 { 106 TimePrec = (UInt32)(Int32)-1; 107 } 108 IsSet_TimePrecCFormatOptions109 bool IsSet_TimePrec() const 110 { 111 return TimePrec != (UInt32)(Int32)-1; 112 } 113 114 Reset_BlockLogSizeCFormatOptions115 void Reset_BlockLogSize() 116 { 117 BlockLogSize = (UInt32)(Int32)-1; 118 } 119 ResetForLevelChangeCFormatOptions120 void ResetForLevelChange() 121 { 122 BlockLogSize = NumThreads = Level = Dictionary = Order = (UInt32)(Int32)-1; 123 // DictionaryChain = (UInt32)(Int32)-1; 124 Method.Empty(); 125 // Options.Empty(); 126 // EncryptionMethod.Empty(); 127 } CFormatOptionsCFormatOptions128 CFormatOptions() 129 { 130 // TimePrec = 0; 131 Reset_TimePrec(); 132 ResetForLevelChange(); 133 } 134 }; 135 136 struct CInfo 137 { 138 UInt32 Level; 139 bool ShowPassword; 140 bool EncryptHeaders; 141 142 CBoolPair NtSecurity; 143 CBoolPair AltStreams; 144 CBoolPair HardLinks; 145 CBoolPair SymLinks; 146 147 CBoolPair PreserveATime; 148 149 UString ArcType; 150 UStringVector ArcPaths; 151 152 CObjectVector<CFormatOptions> Formats; 153 154 void Save() const; 155 void Load(); 156 }; 157 } 158 159 namespace NWorkDir 160 { 161 namespace NMode 162 { 163 enum EEnum 164 { 165 kSystem, 166 kCurrent, 167 kSpecified 168 }; 169 } 170 struct CInfo 171 { 172 NMode::EEnum Mode; 173 bool ForRemovableOnly; 174 FString Path; 175 SetForRemovableOnlyDefaultCInfo176 void SetForRemovableOnlyDefault() { ForRemovableOnly = true; } SetDefaultCInfo177 void SetDefault() 178 { 179 Mode = NMode::kSystem; 180 Path.Empty(); 181 SetForRemovableOnlyDefault(); 182 } 183 184 void Save() const; 185 void Load(); 186 }; 187 } 188 189 190 struct CContextMenuInfo 191 { 192 CBoolPair Cascaded; 193 CBoolPair MenuIcons; 194 CBoolPair ElimDup; 195 196 bool Flags_Def; 197 UInt32 Flags; 198 UInt32 WriteZone; 199 200 /* 201 CContextMenuInfo(): 202 Flags_Def(0), 203 WriteZone((UInt32)(Int32)-1), 204 Flags((UInt32)(Int32)-1) 205 {} 206 */ 207 208 void Save() const; 209 void Load(); 210 }; 211 212 #endif 213