Add other methods to compression dialog

Signed-off-by: SCell555 <kubci.rusnk645@gmail.com>
Co-Authored-By: Tino Reichardt <milky-7zip@mcmilk.de>
This commit is contained in:
Tino Reichardt
2023-01-15 12:42:06 +01:00
parent 3c65c6c314
commit cf29d0c1ba
12 changed files with 407 additions and 59 deletions

View File

@@ -581,7 +581,7 @@ static HRESULT Compress(
UInt32 value;
RINOK(outArchive->GetFileTimeType(&value));
// we support any future fileType here.
fileTimeType = (NFileTimeType::EEnum)value;
@@ -839,6 +839,7 @@ static HRESULT Compress(
}
else
{
single:
outStreamSpec = new COutFileStream;
outSeekStream = outStreamSpec;
outStream = outSeekStream;
@@ -881,6 +882,36 @@ static HRESULT Compress(
if (arc && arc->GetGlobalOffset() > 0)
return E_NOTIMPL;
CMyComPtr<IMultiVolumeOutArchive> multiVolArch;
outArchive->QueryInterface(IID_IMultiVolumeOutArchive, (void**)&multiVolArch);
if (multiVolArch)
{
CPropVariant prefix, postfix, name;
name = archivePath.Name;
BOOL numberAfterExt = FALSE;
UInt32 numberCount = 2;
RINOK(multiVolArch->GetMultiArchiveNameFmt(&name, &prefix, &postfix, &numberAfterExt, &numberCount));
if (prefix.vt != VT_EMPTY && prefix.vt != VT_BSTR)
return E_FAIL;
if (postfix.vt != VT_EMPTY && postfix.vt != VT_BSTR)
return E_FAIL;
updateCallbackSpec->VolumesSizes = options.VolumesSizes;
if (name.vt == VT_BSTR)
updateCallbackSpec->VolName = archivePath.Prefix + name.bstrVal;
else
updateCallbackSpec->VolName = archivePath.Prefix + archivePath.Name;
updateCallbackSpec->VolNumberAfterExt = numberAfterExt != FALSE;
if (prefix.vt == VT_BSTR)
updateCallbackSpec->VolPrefix.SetFromBstr(prefix.bstrVal);
if (postfix.vt == VT_BSTR)
updateCallbackSpec->VolPostfix.SetFromBstr(postfix.bstrVal);
if (!archivePath.VolExtension.IsEmpty())
updateCallbackSpec->VolExt = UString('.') + archivePath.VolExtension;
updateCallbackSpec->DigitCount = numberCount;
const_cast<CRecordVector<UInt64>&>(options.VolumesSizes).Clear();
goto single;
}
volStreamSpec = new COutMultiVolStream;
outSeekStream = volStreamSpec;
outStream = outSeekStream;
@@ -889,13 +920,6 @@ static HRESULT Compress(
volStreamSpec->Prefix += '.';
volStreamSpec->TempFiles = &tempFiles;
volStreamSpec->Init();
/*
updateCallbackSpec->VolumesSizes = volumesSizes;
updateCallbackSpec->VolName = archivePath.Prefix + archivePath.Name;
if (!archivePath.VolExtension.IsEmpty())
updateCallbackSpec->VolExt = UString('.') + archivePath.VolExtension;
*/
}
if (options.SfxMode)
@@ -1433,7 +1457,7 @@ HRESULT UpdateArchive(
dirItems.ScanAltStreams = options.AltStreams.Val;
dirItems.ExcludeDirItems = censor.ExcludeDirItems;
dirItems.ExcludeFileItems = censor.ExcludeFileItems;
dirItems.ShareForWrite = options.OpenShareForWrite;
#ifndef _WIN32