From 3128e3c4d68461c701c0d9ad0f8df2674e3eb756 Mon Sep 17 00:00:00 2001 From: Tino Reichardt Date: Mon, 13 Apr 2020 19:49:54 +0200 Subject: [PATCH] New feature as requested in #97 is ready --- CPP/7zip/UI/Common/CompressCall.cpp | 42 ++++++++++++++++++----------- CPP/7zip/UI/Explorer/makefile | 1 + 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/CPP/7zip/UI/Common/CompressCall.cpp b/CPP/7zip/UI/Common/CompressCall.cpp index 5266dfda..82910e61 100644 --- a/CPP/7zip/UI/Common/CompressCall.cpp +++ b/CPP/7zip/UI/Common/CompressCall.cpp @@ -17,6 +17,7 @@ #include "../../../Windows/ProcessUtils.h" #include "../../../Windows/Synchronization.h" +#include "../FileManager/StringUtils.h" #include "../FileManager/RegistryUtils.h" #include "ZipRegistry.h" @@ -229,7 +230,7 @@ HRESULT CompressFiles( index = FindRegistryFormatAlways(arcType); if (index >= 0) { - char temp[256]; + char temp[64]; const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index]; if (!fo.Method.IsEmpty()) @@ -241,31 +242,43 @@ HRESULT CompressFiles( if (fo.Level) { params += " -mx="; - ConvertUInt64ToString(fo.Level, temp); + ConvertUInt32ToString(fo.Level, temp); params += temp; } + if (fo.Dictionary) + { + params += " -md="; + ConvertUInt32ToString(fo.Dictionary, temp); + params += temp; + params += "b"; + } + + if (fo.BlockLogSize) + { + params += " -ms="; + ConvertUInt32ToString(1 << fo.BlockLogSize, temp); + params += temp; + params += "b"; + } + if (fo.NumThreads) { params += " -mmt="; - ConvertUInt64ToString(fo.NumThreads, temp); + ConvertUInt32ToString(fo.NumThreads, temp); params += temp; } -#if 0 - // need to split the extra Options /TR 2020-04-10 if (!fo.Options.IsEmpty()) { - params += " -m"; - params += fo.Options; + UStringVector strings; + SplitString(fo.Options, strings); + FOR_VECTOR (i, strings) + { + params += " -m"; + params += strings[i]; + } } - - if (!fo.SplitVolume.IsEmpty()) - { - params += " -v"; - params += fo.SplitVolume; - } -#endif } } @@ -297,7 +310,6 @@ HRESULT CompressFiles( arcName); } - // for testing current params, /TR 2017-05-18 // ErrorMessage(params); return Call7zGui(params, // (arcPathPrefix.IsEmpty()? 0: (LPCWSTR)arcPathPrefix), diff --git a/CPP/7zip/UI/Explorer/makefile b/CPP/7zip/UI/Explorer/makefile index 9ad709fc..667b244d 100644 --- a/CPP/7zip/UI/Explorer/makefile +++ b/CPP/7zip/UI/Explorer/makefile @@ -66,6 +66,7 @@ FM_OBJS = \ $O\LangUtils.obj \ $O\ProgramLocation.obj \ $O\RegistryUtils.obj \ + $O\StringUtils.obj \ C_OBJS = \ $O\CpuArch.obj \