mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-11 16:07:10 -06:00
Update to 7-Zip Version 22.00
See: https://sourceforge.net/p/sevenzip/discussion/45797/thread/9c2d9061ce/
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
#include "../../../Windows/Synchronization.h"
|
||||
#endif
|
||||
|
||||
// #include "../Common/PropIDUtils.h"
|
||||
|
||||
#include "ConsoleClose.h"
|
||||
#include "UserInputUtils.h"
|
||||
#include "UpdateCallbackConsole.h"
|
||||
@@ -195,6 +197,22 @@ void CCallbackConsoleBase::CommonError(const FString &path, DWORD systemError, b
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void CCallbackConsoleBase::CommonError(const char *message)
|
||||
{
|
||||
ClosePercents2();
|
||||
|
||||
if (_se)
|
||||
{
|
||||
if (_so)
|
||||
_so->Flush();
|
||||
|
||||
*_se << endl << kError << message << endl;
|
||||
_se->Flush();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
HRESULT CCallbackConsoleBase::ScanError_Base(const FString &path, DWORD systemError)
|
||||
{
|
||||
@@ -519,6 +537,28 @@ HRESULT CCallbackConsoleBase::PrintProgress(const wchar_t *name, bool isDir, con
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void CCallbackConsoleBase::PrintInfoLine(const UString &s)
|
||||
{
|
||||
if (LogLevel < 1000)
|
||||
return;
|
||||
|
||||
MT_LOCK
|
||||
|
||||
const bool show2 = (_so != NULL);
|
||||
|
||||
if (show2)
|
||||
{
|
||||
ClosePercents_for_so();
|
||||
_so->PrintUString(s, _tempA);
|
||||
*_so << endl;
|
||||
if (NeedFlush)
|
||||
_so->Flush();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
HRESULT CUpdateCallbackConsole::GetStream(const wchar_t *name, bool isDir, bool isAnti, UInt32 mode)
|
||||
{
|
||||
if (StdOutMode)
|
||||
@@ -562,10 +602,19 @@ HRESULT CUpdateCallbackConsole::ReadingFileError(const FString &path, DWORD syst
|
||||
return ReadingFileError_Base(path, systemError);
|
||||
}
|
||||
|
||||
HRESULT CUpdateCallbackConsole::SetOperationResult(Int32)
|
||||
HRESULT CUpdateCallbackConsole::SetOperationResult(Int32 /* opRes */)
|
||||
{
|
||||
MT_LOCK
|
||||
_percent.Files++;
|
||||
/*
|
||||
if (opRes != NArchive::NUpdate::NOperationResult::kOK)
|
||||
{
|
||||
if (opRes == NArchive::NUpdate::NOperationResult::kError_FileChanged)
|
||||
{
|
||||
CommonError("Input file changed");
|
||||
}
|
||||
}
|
||||
*/
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -616,6 +665,8 @@ HRESULT CUpdateCallbackConsole::ReportUpdateOperation(UInt32 op, const wchar_t *
|
||||
case NUpdateNotifyOp::kSkip: s = "."; requiredLevel = 2; break;
|
||||
case NUpdateNotifyOp::kDelete: s = "D"; requiredLevel = 3; break;
|
||||
case NUpdateNotifyOp::kHeader: s = "Header creation"; requiredLevel = 100; break;
|
||||
case NUpdateNotifyOp::kInFileChanged: s = "Size of input file was changed:"; requiredLevel = 10; break;
|
||||
// case NUpdateNotifyOp::kOpFinished: s = "Finished"; requiredLevel = 100; break;
|
||||
default:
|
||||
{
|
||||
temp[0] = 'o';
|
||||
@@ -710,3 +761,119 @@ HRESULT CUpdateCallbackConsole::ShowDeleteFile(const wchar_t *name, bool isDir)
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
void GetPropName(PROPID propID, const wchar_t *name, AString &nameA, UString &nameU);
|
||||
|
||||
static void GetPropName(PROPID propID, UString &nameU)
|
||||
{
|
||||
AString nameA;
|
||||
GetPropName(propID, NULL, nameA, nameU);
|
||||
// if (!nameA.IsEmpty())
|
||||
nameU = nameA;
|
||||
}
|
||||
|
||||
|
||||
static void AddPropNamePrefix(UString &s, PROPID propID)
|
||||
{
|
||||
UString name;
|
||||
GetPropName(propID, name);
|
||||
s += name;
|
||||
s += " = ";
|
||||
}
|
||||
|
||||
void CCallbackConsoleBase::PrintPropInfo(UString &s, PROPID propID, const PROPVARIANT *value)
|
||||
{
|
||||
AddPropNamePrefix(s, propID);
|
||||
{
|
||||
UString dest;
|
||||
const int level = 9; // we show up to ns precision level
|
||||
ConvertPropertyToString2(dest, *value, propID, level);
|
||||
s += dest;
|
||||
}
|
||||
PrintInfoLine(s);
|
||||
}
|
||||
|
||||
static void Add_IndexType_Index(UString &s, UInt32 indexType, UInt32 index)
|
||||
{
|
||||
if (indexType == NArchive::NEventIndexType::kArcProp)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if (indexType == NArchive::NEventIndexType::kBlockIndex)
|
||||
{
|
||||
s += "#";
|
||||
}
|
||||
else if (indexType == NArchive::NEventIndexType::kOutArcIndex)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
s += "indexType_";
|
||||
s.Add_UInt32(indexType);
|
||||
s.Add_Space();
|
||||
}
|
||||
s.Add_UInt32(index);
|
||||
}
|
||||
s += ": ";
|
||||
}
|
||||
|
||||
HRESULT CUpdateCallbackConsole::ReportProp(UInt32 indexType, UInt32 index, PROPID propID, const PROPVARIANT *value)
|
||||
{
|
||||
UString s;
|
||||
Add_IndexType_Index(s, indexType, index);
|
||||
PrintPropInfo(s, propID, value);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static inline char GetHex(Byte value)
|
||||
{
|
||||
return (char)((value < 10) ? ('0' + value) : ('a' + (value - 10)));
|
||||
}
|
||||
|
||||
static void AddHexToString(UString &dest, const Byte *data, UInt32 size)
|
||||
{
|
||||
for (UInt32 i = 0; i < size; i++)
|
||||
{
|
||||
Byte b = data[i];
|
||||
dest += GetHex((Byte)((b >> 4) & 0xF));
|
||||
dest += GetHex((Byte)(b & 0xF));
|
||||
}
|
||||
}
|
||||
|
||||
void HashHexToString(char *dest, const Byte *data, UInt32 size);
|
||||
|
||||
HRESULT CUpdateCallbackConsole::ReportRawProp(UInt32 indexType, UInt32 index,
|
||||
PROPID propID, const void *data, UInt32 dataSize, UInt32 propType)
|
||||
{
|
||||
UString s;
|
||||
propType = propType;
|
||||
Add_IndexType_Index(s, indexType, index);
|
||||
AddPropNamePrefix(s, propID);
|
||||
if (propID == kpidChecksum)
|
||||
{
|
||||
char temp[k_HashCalc_DigestSize_Max + 8];
|
||||
HashHexToString(temp, (const Byte *)data, dataSize);
|
||||
s += temp;
|
||||
}
|
||||
else
|
||||
AddHexToString(s, (const Byte *)data, dataSize);
|
||||
PrintInfoLine(s);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CUpdateCallbackConsole::ReportFinished(UInt32 indexType, UInt32 index, Int32 opRes)
|
||||
{
|
||||
UString s;
|
||||
Add_IndexType_Index(s, indexType, index);
|
||||
s += "finished";
|
||||
if (opRes != NArchive::NUpdate::NOperationResult::kOK)
|
||||
{
|
||||
s += ": ";
|
||||
s.Add_UInt32(opRes);
|
||||
}
|
||||
PrintInfoLine(s);
|
||||
return S_OK;
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user