mirror of
https://github.com/Xevion/easy7zip.git
synced 2026-01-31 20:24:05 -06:00
Update to 7-Zip Version 21.04
- first test... no release!!!
This commit is contained in:
@@ -38,7 +38,8 @@ static void ThrowException_if_Error(HRESULT res)
|
||||
#define CREATE_CODECS \
|
||||
CCodecs *codecs = new CCodecs; \
|
||||
CMyComPtr<ICompressCodecsInfo> compressCodecsInfo = codecs; \
|
||||
ThrowException_if_Error(codecs->Load());
|
||||
ThrowException_if_Error(codecs->Load()); \
|
||||
Codecs_AddHashArcHandler(codecs);
|
||||
|
||||
#define LOAD_EXTERNAL_CODECS \
|
||||
CExternalCodecs __externalCodecs; \
|
||||
@@ -51,7 +52,8 @@ static void ThrowException_if_Error(HRESULT res)
|
||||
#define CREATE_CODECS \
|
||||
CCodecs *codecs = new CCodecs; \
|
||||
CMyComPtr<IUnknown> compressCodecsInfo = codecs; \
|
||||
ThrowException_if_Error(codecs->Load());
|
||||
ThrowException_if_Error(codecs->Load()); \
|
||||
Codecs_AddHashArcHandler(codecs);
|
||||
|
||||
#define LOAD_EXTERNAL_CODECS
|
||||
|
||||
@@ -150,7 +152,8 @@ HRESULT CompressFiles(
|
||||
|
||||
|
||||
static HRESULT ExtractGroupCommand(const UStringVector &arcPaths,
|
||||
bool showDialog, const UString &outFolder, bool testMode, bool elimDup = false)
|
||||
bool showDialog, const UString &outFolder, bool testMode, bool elimDup = false,
|
||||
const char *kType = NULL)
|
||||
{
|
||||
MY_TRY_BEGIN
|
||||
|
||||
@@ -187,6 +190,15 @@ static HRESULT ExtractGroupCommand(const UStringVector &arcPaths,
|
||||
}
|
||||
|
||||
CObjectVector<COpenType> formatIndices;
|
||||
if (kType)
|
||||
{
|
||||
if (!ParseOpenTypes(*codecs, UString(kType), formatIndices))
|
||||
{
|
||||
throw CSystemException(E_INVALIDARG);
|
||||
// ErrorLangMessage(IDS_UNSUPPORTED_ARCHIVE_TYPE);
|
||||
// return E_INVALIDARG;
|
||||
}
|
||||
}
|
||||
|
||||
NWildcard::CCensor censor;
|
||||
{
|
||||
@@ -221,14 +233,34 @@ void ExtractArchives(const UStringVector &arcPaths, const UString &outFolder, bo
|
||||
ExtractGroupCommand(arcPaths, showDialog, outFolder, false, elimDup);
|
||||
}
|
||||
|
||||
void TestArchives(const UStringVector &arcPaths)
|
||||
void TestArchives(const UStringVector &arcPaths, bool hashMode)
|
||||
{
|
||||
ExtractGroupCommand(arcPaths, true, UString(), true);
|
||||
ExtractGroupCommand(arcPaths, true, UString(), true,
|
||||
false, // elimDup
|
||||
hashMode ? "hash" : NULL);
|
||||
}
|
||||
|
||||
void CalcChecksum(const UStringVector &paths, const UString &methodName)
|
||||
void CalcChecksum(const UStringVector &paths,
|
||||
const UString &methodName,
|
||||
const UString &arcPathPrefix,
|
||||
const UString &arcFileName)
|
||||
{
|
||||
MY_TRY_BEGIN
|
||||
|
||||
if (!arcFileName.IsEmpty())
|
||||
{
|
||||
CompressFiles(
|
||||
arcPathPrefix,
|
||||
arcFileName,
|
||||
UString("hash"),
|
||||
false, // addExtension,
|
||||
paths,
|
||||
false, // email,
|
||||
false, // showDialog,
|
||||
false // waitFinish
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
CREATE_CODECS
|
||||
LOAD_EXTERNAL_CODECS
|
||||
@@ -245,6 +277,11 @@ void CalcChecksum(const UStringVector &paths, const UString &methodName)
|
||||
CHashOptions options;
|
||||
options.Methods.Add(methodName);
|
||||
|
||||
/*
|
||||
if (!arcFileName.IsEmpty())
|
||||
options.HashFilePath = arcPathPrefix + arcFileName;
|
||||
*/
|
||||
|
||||
result = HashCalcGUI(EXTERNAL_CODECS_VARS_L censor, options, messageWasDisplayed);
|
||||
if (result != S_OK)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user