mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 04:07:02 -06:00
4.53 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
33ccab7e72
commit
051769bbc5
@@ -648,6 +648,14 @@ SOURCE=..\..\Common\FileStreams.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\ProgressUtils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\ProgressUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\RegisterArc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -95,7 +95,7 @@ STDMETHODIMP CExtractCallbackConsole::AskOverwrite(
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int32 askExtractMode, const UInt64 *position)
|
||||
STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, bool /* isFolder */, Int32 askExtractMode, const UInt64 *position)
|
||||
{
|
||||
switch (askExtractMode)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
|
||||
const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
|
||||
Int32 *answer);
|
||||
STDMETHOD (PrepareOperation)(const wchar_t *name, Int32 askExtractMode, const UInt64 *position);
|
||||
STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position);
|
||||
|
||||
STDMETHOD(MessageError)(const wchar_t *message);
|
||||
STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted);
|
||||
|
||||
@@ -57,7 +57,17 @@ static CPropIdToName kPropIdToName[] =
|
||||
{ kpidGroup, L"Group" },
|
||||
{ kpidBlock, L"Block" },
|
||||
{ kpidComment, L"Comment" },
|
||||
{ kpidPosition, L"Position" }
|
||||
{ kpidPosition, L"Position" },
|
||||
{ kpidPrefix, L"Prefix" },
|
||||
{ kpidNumSubFolders, L"Folders" },
|
||||
{ kpidNumSubFiles, L"Files" },
|
||||
{ kpidUnpackVer, L"Version" },
|
||||
{ kpidVolume, L"Volume" },
|
||||
{ kpidIsVolume, L"Multivolume" },
|
||||
{ kpidOffset, L"Offset" },
|
||||
{ kpidLinks, L"Links" },
|
||||
{ kpidNumBlocks, L"Blocks" },
|
||||
{ kpidNumVolumes, L"Volumes" }
|
||||
};
|
||||
|
||||
static const char kEmptyAttributeChar = '.';
|
||||
@@ -184,6 +194,19 @@ void CFieldPrinter::Init(const CFieldInfoInit *standardFieldTable, int numItems)
|
||||
}
|
||||
}
|
||||
|
||||
static UString GetPropName(PROPID propID, BSTR name)
|
||||
{
|
||||
for (int i = 0; i < sizeof(kPropIdToName) / sizeof(kPropIdToName[0]); i++)
|
||||
{
|
||||
const CPropIdToName &propIdToName = kPropIdToName[i];
|
||||
if (propIdToName.PropID == propID)
|
||||
return propIdToName.Name;
|
||||
}
|
||||
if (name)
|
||||
return name;
|
||||
return L"?";
|
||||
}
|
||||
|
||||
HRESULT CFieldPrinter::Init(IInArchive *archive)
|
||||
{
|
||||
Clear();
|
||||
@@ -197,21 +220,7 @@ HRESULT CFieldPrinter::Init(IInArchive *archive)
|
||||
RINOK(archive->GetPropertyInfo(i, &name, &propID, &vt));
|
||||
CFieldInfo fieldInfo;
|
||||
fieldInfo.PropID = propID;
|
||||
if (name != NULL)
|
||||
fieldInfo.Name = name;
|
||||
else
|
||||
{
|
||||
fieldInfo.Name = L"Unknown";
|
||||
for (int i = 0; i < sizeof(kPropIdToName) / sizeof(kPropIdToName[0]); i++)
|
||||
{
|
||||
const CPropIdToName &propIdToName = kPropIdToName[i];
|
||||
if (propIdToName.PropID == propID)
|
||||
{
|
||||
fieldInfo.Name = propIdToName.Name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fieldInfo.Name = GetPropName(propID, name);
|
||||
_fields.Add(fieldInfo);
|
||||
}
|
||||
return S_OK;
|
||||
@@ -463,14 +472,28 @@ HRESULT ListArchives(
|
||||
{
|
||||
g_StdOut << endl << kListing << archiveName << endl << endl;
|
||||
|
||||
NCOM::CPropVariant propVariant;
|
||||
RINOK(archive->GetArchiveProperty(kpidComment, &propVariant));
|
||||
if (propVariant.vt != VT_EMPTY)
|
||||
UInt32 numProps;
|
||||
if (archive->GetNumberOfArchiveProperties(&numProps) == S_OK)
|
||||
{
|
||||
UString s = ConvertPropertyToString(propVariant, kpidComment);
|
||||
if (!s.IsEmpty())
|
||||
g_StdOut << "Comment:\n" << s << "\n\n";
|
||||
for (UInt32 i = 0; i < numProps; i++)
|
||||
{
|
||||
CMyComBSTR name;
|
||||
PROPID propID;
|
||||
VARTYPE vt;
|
||||
if (archive->GetArchivePropertyInfo(i, &name, &propID, &vt) != S_OK)
|
||||
continue;
|
||||
NCOM::CPropVariant prop;
|
||||
if (archive->GetArchiveProperty(propID, &prop) != S_OK)
|
||||
continue;
|
||||
UString s = ConvertPropertyToString(prop, propID);
|
||||
if (!s.IsEmpty())
|
||||
g_StdOut << GetPropName(propID, name) << " = " << s << endl;
|
||||
}
|
||||
}
|
||||
if (techMode)
|
||||
g_StdOut << "----------\n";
|
||||
if (numProps > 0)
|
||||
g_StdOut << endl;
|
||||
}
|
||||
|
||||
if (enableHeaders && !techMode)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Main.cpp
|
||||
/ Main.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
@@ -396,12 +396,13 @@ int Main2(
|
||||
eo.Properties = options.ExtractProperties;
|
||||
#endif
|
||||
UString errorMessage;
|
||||
CDecompressStat stat;
|
||||
HRESULT result = DecompressArchives(
|
||||
codecs,
|
||||
options.ArchivePathsSorted,
|
||||
options.ArchivePathsFullSorted,
|
||||
options.WildcardCensor.Pairs.Front().Head,
|
||||
eo, &openCallback, ecs, errorMessage);
|
||||
eo, &openCallback, ecs, errorMessage, stat);
|
||||
if (!errorMessage.IsEmpty())
|
||||
{
|
||||
stdStream << endl << "Error: " << errorMessage;
|
||||
@@ -409,15 +410,20 @@ int Main2(
|
||||
result = E_FAIL;
|
||||
}
|
||||
|
||||
stdStream << endl << endl << "Total:" << endl;
|
||||
if (ecs->NumArchives > 1)
|
||||
{
|
||||
stdStream << endl << endl << "Total:" << endl;
|
||||
stdStream << "Archives: " << ecs->NumArchives << endl;
|
||||
{
|
||||
stdStream << "Folders: " << stat.NumFolders << endl;
|
||||
stdStream << "Files: " << stat.NumFiles << endl;
|
||||
stdStream << "Size: " << stat.UnpackSize << endl;
|
||||
stdStream << "Compressed: " << stat.PackSize << endl;
|
||||
}
|
||||
if (ecs->NumArchiveErrors != 0 || ecs->NumFileErrors != 0)
|
||||
{
|
||||
if (ecs->NumArchives > 1)
|
||||
{
|
||||
stdStream << endl;
|
||||
if (ecs->NumArchiveErrors != 0)
|
||||
stdStream << "Archive Errors: " << ecs->NumArchiveErrors << endl;
|
||||
if (ecs->NumFileErrors != 0)
|
||||
|
||||
@@ -112,6 +112,11 @@ HRESULT CUpdateCallbackConsole::Finilize()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CUpdateCallbackConsole::SetNumFiles(UInt64 /* numFiles */)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CUpdateCallbackConsole::SetTotal(UInt64 size)
|
||||
{
|
||||
MT_LOCK
|
||||
@@ -137,6 +142,15 @@ HRESULT CUpdateCallbackConsole::SetCompleted(const UInt64 *completeValue)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CUpdateCallbackConsole::SetRatioInfo(const UInt64 * /* inSize */, const UInt64 * /* outSize */)
|
||||
{
|
||||
/*
|
||||
if (NConsoleClose::TestBreakSignal())
|
||||
return E_ABORT;
|
||||
*/
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CUpdateCallbackConsole::GetStream(const wchar_t *name, bool isAnti)
|
||||
{
|
||||
MT_LOCK
|
||||
|
||||
@@ -46,24 +46,7 @@ public:
|
||||
m_PercentPrinter.OutStream = outStream;
|
||||
}
|
||||
|
||||
HRESULT OpenResult(const wchar_t *name, HRESULT result);
|
||||
|
||||
HRESULT StartScanning();
|
||||
HRESULT CanNotFindError(const wchar_t *name, DWORD systemError);
|
||||
HRESULT FinishScanning();
|
||||
|
||||
HRESULT StartArchive(const wchar_t *name, bool updating);
|
||||
HRESULT FinishArchive();
|
||||
|
||||
HRESULT CheckBreak();
|
||||
HRESULT Finilize();
|
||||
HRESULT SetTotal(UInt64 size);
|
||||
HRESULT SetCompleted(const UInt64 *completeValue);
|
||||
|
||||
HRESULT GetStream(const wchar_t *name, bool isAnti);
|
||||
HRESULT OpenFileError(const wchar_t *name, DWORD systemError);
|
||||
HRESULT SetOperationResult(Int32 operationResult);
|
||||
HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password);
|
||||
INTERFACE_IUpdateCallbackUI2(;)
|
||||
|
||||
UStringVector FailedFiles;
|
||||
CRecordVector<HRESULT> FailedCodes;
|
||||
|
||||
@@ -51,6 +51,7 @@ WIN_OBJS = \
|
||||
7ZIP_COMMON_OBJS = \
|
||||
$O\FilePathAutoRename.obj \
|
||||
$O\FileStreams.obj \
|
||||
$O\ProgressUtils.obj \
|
||||
$O\StreamUtils.obj \
|
||||
|
||||
UI_COMMON_OBJS = \
|
||||
|
||||
Reference in New Issue
Block a user