mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-09 00:07:00 -06:00
21.04
This commit is contained in:
@@ -405,6 +405,14 @@ SOURCE=..\..\..\Common\Defs.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\DynLimBuf.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\DynLimBuf.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\IntToString.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -886,6 +894,14 @@ SOURCE=..\..\..\..\C\Threads.h
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Archive\Common\ItemNameUtils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Archive\Common\ItemNameUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Archive\Common\OutStreamWithCRC.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -187,6 +187,7 @@ static NSynchronization::CCriticalSection g_CriticalSection;
|
||||
static const char * const kTestString = "T";
|
||||
static const char * const kExtractString = "-";
|
||||
static const char * const kSkipString = ".";
|
||||
static const char * const kReadString = "H";
|
||||
|
||||
// static const char * const kCantAutoRename = "cannot create file with auto name\n";
|
||||
// static const char * const kCantRenameFile = "cannot rename existing file\n";
|
||||
@@ -317,7 +318,7 @@ STDMETHODIMP CExtractCallbackConsole::AskOverwrite(
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int32 /* isFolder */, Int32 askExtractMode, const UInt64 *position)
|
||||
STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int32 isFolder, Int32 askExtractMode, const UInt64 *position)
|
||||
{
|
||||
MT_LOCK
|
||||
|
||||
@@ -331,6 +332,7 @@ STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int3
|
||||
case NArchive::NExtract::NAskMode::kExtract: s = kExtractString; break;
|
||||
case NArchive::NExtract::NAskMode::kTest: s = kTestString; break;
|
||||
case NArchive::NExtract::NAskMode::kSkip: s = kSkipString; requiredLevel = 2; break;
|
||||
case NArchive::NExtract::NAskMode::kReadExternal: s = kReadString; requiredLevel = 0; break;
|
||||
default: s = "???"; requiredLevel = 2;
|
||||
};
|
||||
|
||||
@@ -350,6 +352,12 @@ STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int3
|
||||
{
|
||||
_tempU = name;
|
||||
_so->Normalize_UString(_tempU);
|
||||
// 21.04
|
||||
if (isFolder)
|
||||
{
|
||||
if (!_tempU.IsEmpty() && _tempU.Back() != WCHAR_PATH_SEPARATOR)
|
||||
_tempU.Add_PathSepar();
|
||||
}
|
||||
}
|
||||
_so->PrintUString(_tempU, _tempA);
|
||||
if (position)
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "../../../Common/IntToString.h"
|
||||
|
||||
#include "../../../Windows/FileName.h"
|
||||
|
||||
#include "ConsoleClose.h"
|
||||
#include "HashCon.h"
|
||||
|
||||
@@ -33,13 +35,15 @@ HRESULT CHashCallbackConsole::StartScanning()
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
HRESULT CHashCallbackConsole::ScanProgress(const CDirItemsStat &st, const FString &path, bool /* isDir */)
|
||||
HRESULT CHashCallbackConsole::ScanProgress(const CDirItemsStat &st, const FString &path, bool isDir)
|
||||
{
|
||||
if (NeedPercents())
|
||||
{
|
||||
_percent.Files = st.NumDirs + st.NumFiles + st.NumAltStreams;
|
||||
_percent.Completed = st.GetTotalBytes();
|
||||
_percent.FileName = fs2us(path);
|
||||
if (isDir)
|
||||
NWindows::NFile::NName::NormalizeDirPathPrefix(_percent.FileName);
|
||||
_percent.Print();
|
||||
}
|
||||
return CheckBreak2();
|
||||
@@ -111,6 +115,15 @@ static void SetSpacesAndNul(char *s, unsigned num)
|
||||
s[num] = 0;
|
||||
}
|
||||
|
||||
static void SetSpacesAndNul_if_Positive(char *s, int num)
|
||||
{
|
||||
if (num < 0)
|
||||
return;
|
||||
for (int i = 0; i < num; i++)
|
||||
s[i] = ' ';
|
||||
s[num] = 0;
|
||||
}
|
||||
|
||||
static const unsigned kSizeField_Len = 13;
|
||||
static const unsigned kNameField_Len = 12;
|
||||
|
||||
@@ -122,61 +135,83 @@ static unsigned GetColumnWidth(unsigned digestSize)
|
||||
return width < kHashColumnWidth_Min ? kHashColumnWidth_Min: width;
|
||||
}
|
||||
|
||||
|
||||
AString CHashCallbackConsole::GetFields() const
|
||||
{
|
||||
AString s = PrintFields;
|
||||
if (s.IsEmpty())
|
||||
s = "hsn";
|
||||
s.MakeLower_Ascii();
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
void CHashCallbackConsole::PrintSeparatorLine(const CObjectVector<CHasherState> &hashers)
|
||||
{
|
||||
_s.Empty();
|
||||
|
||||
for (unsigned i = 0; i < hashers.Size(); i++)
|
||||
const AString fields = GetFields();
|
||||
for (unsigned pos = 0; pos < fields.Len(); pos++)
|
||||
{
|
||||
if (i != 0)
|
||||
_s.Add_Space();
|
||||
const CHasherState &h = hashers[i];
|
||||
AddMinuses(_s, GetColumnWidth(h.DigestSize));
|
||||
}
|
||||
|
||||
if (PrintSize)
|
||||
{
|
||||
_s.Add_Space();
|
||||
AddMinuses(_s, kSizeField_Len);
|
||||
}
|
||||
|
||||
if (PrintName)
|
||||
{
|
||||
AddSpacesBeforeName();
|
||||
AddMinuses(_s, kNameField_Len);
|
||||
const char c = fields[pos];
|
||||
if (c == 'h')
|
||||
{
|
||||
for (unsigned i = 0; i < hashers.Size(); i++)
|
||||
{
|
||||
AddSpace();
|
||||
const CHasherState &h = hashers[i];
|
||||
AddMinuses(_s, GetColumnWidth(h.DigestSize));
|
||||
}
|
||||
}
|
||||
else if (c == 's')
|
||||
{
|
||||
AddSpace();
|
||||
AddMinuses(_s, kSizeField_Len);
|
||||
}
|
||||
else if (c == 'n')
|
||||
{
|
||||
AddSpacesBeforeName();
|
||||
AddMinuses(_s, kNameField_Len);
|
||||
}
|
||||
}
|
||||
|
||||
*_so << _s << endl;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CHashCallbackConsole::BeforeFirstFile(const CHashBundle &hb)
|
||||
{
|
||||
if (PrintHeaders && _so)
|
||||
{
|
||||
_s.Empty();
|
||||
ClosePercents_for_so();
|
||||
|
||||
FOR_VECTOR (i, hb.Hashers)
|
||||
|
||||
const AString fields = GetFields();
|
||||
for (unsigned pos = 0; pos < fields.Len(); pos++)
|
||||
{
|
||||
if (i != 0)
|
||||
_s.Add_Space();
|
||||
const CHasherState &h = hb.Hashers[i];
|
||||
_s += h.Name;
|
||||
AddSpaces_if_Positive(_s, (int)GetColumnWidth(h.DigestSize) - (int)h.Name.Len());
|
||||
}
|
||||
|
||||
if (PrintSize)
|
||||
{
|
||||
_s.Add_Space();
|
||||
const AString s2 ("Size");
|
||||
AddSpaces_if_Positive(_s, (int)kSizeField_Len - (int)s2.Len());
|
||||
_s += s2;
|
||||
}
|
||||
|
||||
if (PrintName)
|
||||
{
|
||||
AddSpacesBeforeName();
|
||||
_s += "Name";
|
||||
const char c = fields[pos];
|
||||
if (c == 'h')
|
||||
{
|
||||
FOR_VECTOR (i, hb.Hashers)
|
||||
{
|
||||
AddSpace();
|
||||
const CHasherState &h = hb.Hashers[i];
|
||||
_s += h.Name;
|
||||
AddSpaces_if_Positive(_s, (int)GetColumnWidth(h.DigestSize) - (int)h.Name.Len());
|
||||
}
|
||||
}
|
||||
|
||||
else if (c == 's')
|
||||
{
|
||||
AddSpace();
|
||||
const AString s2 ("Size");
|
||||
AddSpaces_if_Positive(_s, (int)kSizeField_Len - (int)s2.Len());
|
||||
_s += s2;
|
||||
}
|
||||
else if (c == 'n')
|
||||
{
|
||||
AddSpacesBeforeName();
|
||||
_s += "Name";
|
||||
}
|
||||
}
|
||||
|
||||
*_so << _s << endl;
|
||||
@@ -191,9 +226,11 @@ HRESULT CHashCallbackConsole::OpenFileError(const FString &path, DWORD systemErr
|
||||
return OpenFileError_Base(path, systemError);
|
||||
}
|
||||
|
||||
HRESULT CHashCallbackConsole::GetStream(const wchar_t *name, bool /* isFolder */)
|
||||
HRESULT CHashCallbackConsole::GetStream(const wchar_t *name, bool isDir)
|
||||
{
|
||||
_fileName = name;
|
||||
if (isDir)
|
||||
NWindows::NFile::NName::NormalizeDirPathPrefix(_fileName);
|
||||
|
||||
if (NeedPercents())
|
||||
{
|
||||
@@ -208,57 +245,81 @@ HRESULT CHashCallbackConsole::GetStream(const wchar_t *name, bool /* isFolder */
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
|
||||
static const unsigned k_DigestStringSize = k_HashCalc_DigestSize_Max * 2 + k_HashCalc_ExtraSize * 2 + 16;
|
||||
|
||||
|
||||
|
||||
void CHashCallbackConsole::PrintResultLine(UInt64 fileSize,
|
||||
const CObjectVector<CHasherState> &hashers, unsigned digestIndex, bool showHash)
|
||||
const CObjectVector<CHasherState> &hashers, unsigned digestIndex, bool showHash,
|
||||
const AString &path)
|
||||
{
|
||||
ClosePercents_for_so();
|
||||
|
||||
_s.Empty();
|
||||
|
||||
FOR_VECTOR (i, hashers)
|
||||
{
|
||||
const CHasherState &h = hashers[i];
|
||||
char s[k_HashCalc_DigestSize_Max * 2 + 64];
|
||||
s[0] = 0;
|
||||
if (showHash)
|
||||
AddHashHexToString(s, h.Digests[digestIndex], h.DigestSize);
|
||||
const unsigned pos = (unsigned)strlen(s);
|
||||
SetSpacesAndNul(s + pos, GetColumnWidth(h.DigestSize) - pos);
|
||||
if (i != 0)
|
||||
_s.Add_Space();
|
||||
_s += s;
|
||||
}
|
||||
const AString fields = GetFields();
|
||||
|
||||
if (PrintSize)
|
||||
for (unsigned pos = 0; pos < fields.Len(); pos++)
|
||||
{
|
||||
_s.Add_Space();
|
||||
|
||||
char s[kSizeField_Len + 32];
|
||||
char *p = s;
|
||||
|
||||
SetSpacesAndNul(s, kSizeField_Len);
|
||||
if (showHash)
|
||||
const char c = fields[pos];
|
||||
if (c == 'h')
|
||||
{
|
||||
p = s + kSizeField_Len;
|
||||
ConvertUInt64ToString(fileSize, p);
|
||||
int numSpaces = (int)kSizeField_Len - (int)strlen(p);
|
||||
if (numSpaces > 0)
|
||||
p -= (unsigned)numSpaces;
|
||||
FOR_VECTOR (i, hashers)
|
||||
{
|
||||
AddSpace();
|
||||
const CHasherState &h = hashers[i];
|
||||
char s[k_DigestStringSize];
|
||||
s[0] = 0;
|
||||
if (showHash)
|
||||
h.WriteToString(digestIndex, s);
|
||||
const unsigned len = (unsigned)strlen(s);
|
||||
SetSpacesAndNul_if_Positive(s + len, (int)GetColumnWidth(h.DigestSize) - (int)len);
|
||||
_s += s;
|
||||
}
|
||||
}
|
||||
else if (c == 's')
|
||||
{
|
||||
AddSpace();
|
||||
char s[kSizeField_Len + 32];
|
||||
char *p = s;
|
||||
SetSpacesAndNul(s, kSizeField_Len);
|
||||
if (showHash)
|
||||
{
|
||||
p = s + kSizeField_Len;
|
||||
ConvertUInt64ToString(fileSize, p);
|
||||
const int numSpaces = (int)kSizeField_Len - (int)strlen(p);
|
||||
if (numSpaces > 0)
|
||||
p -= (unsigned)numSpaces;
|
||||
}
|
||||
_s += p;
|
||||
}
|
||||
else if (c == 'n')
|
||||
{
|
||||
AddSpacesBeforeName();
|
||||
_s += path;
|
||||
}
|
||||
|
||||
_s += p;
|
||||
}
|
||||
|
||||
if (PrintName)
|
||||
AddSpacesBeforeName();
|
||||
|
||||
*_so << _s;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CHashCallbackConsole::SetOperationResult(UInt64 fileSize, const CHashBundle &hb, bool showHash)
|
||||
{
|
||||
if (_so)
|
||||
{
|
||||
AString s;
|
||||
if (_fileName.IsEmpty())
|
||||
s = kEmptyFileAlias;
|
||||
else
|
||||
{
|
||||
UString temp = _fileName;
|
||||
_so->Normalize_UString(temp);
|
||||
_so->Convert_UString_to_AString(temp, s);
|
||||
}
|
||||
PrintResultLine(fileSize, hb.Hashers, k_HashCalc_Index_Current, showHash, s);
|
||||
|
||||
/*
|
||||
PrintResultLine(fileSize, hb.Hashers, k_HashCalc_Index_Current, showHash);
|
||||
if (PrintName)
|
||||
{
|
||||
@@ -267,7 +328,9 @@ HRESULT CHashCallbackConsole::SetOperationResult(UInt64 fileSize, const CHashBun
|
||||
else
|
||||
_so->NormalizePrint_UString(_fileName);
|
||||
}
|
||||
*_so << endl;
|
||||
*/
|
||||
// if (PrintNewLine)
|
||||
*_so << endl;
|
||||
}
|
||||
|
||||
if (NeedPercents())
|
||||
@@ -299,9 +362,9 @@ static void PrintSum(CStdOutStream &so, const CHasherState &h, unsigned digestIn
|
||||
|
||||
so << k_DigestTitles[digestIndex];
|
||||
|
||||
char s[k_HashCalc_DigestSize_Max * 2 + 64];
|
||||
s[0] = 0;
|
||||
AddHashHexToString(s, h.Digests[digestIndex], h.DigestSize);
|
||||
char s[k_DigestStringSize];
|
||||
// s[0] = 0;
|
||||
h.WriteToString(digestIndex, s);
|
||||
so << s << endl;
|
||||
}
|
||||
|
||||
@@ -336,7 +399,7 @@ HRESULT CHashCallbackConsole::AfterLastFile(CHashBundle &hb)
|
||||
{
|
||||
PrintSeparatorLine(hb.Hashers);
|
||||
|
||||
PrintResultLine(hb.FilesSize, hb.Hashers, k_HashCalc_Index_DataSum, true);
|
||||
PrintResultLine(hb.FilesSize, hb.Hashers, k_HashCalc_Index_DataSum, true, AString());
|
||||
|
||||
*_so << endl << endl;
|
||||
|
||||
|
||||
@@ -12,15 +12,23 @@ class CHashCallbackConsole: public IHashCallbackUI, public CCallbackConsoleBase
|
||||
UString _fileName;
|
||||
AString _s;
|
||||
|
||||
void AddSpace()
|
||||
{
|
||||
_s.Add_Space_if_NotEmpty();
|
||||
}
|
||||
|
||||
void AddSpacesBeforeName()
|
||||
{
|
||||
_s.Add_Space();
|
||||
_s.Add_Space();
|
||||
if (!_s.IsEmpty())
|
||||
{
|
||||
_s.Add_Space();
|
||||
_s.Add_Space();
|
||||
}
|
||||
}
|
||||
|
||||
void PrintSeparatorLine(const CObjectVector<CHasherState> &hashers);
|
||||
void PrintResultLine(UInt64 fileSize,
|
||||
const CObjectVector<CHasherState> &hashers, unsigned digestIndex, bool showHash);
|
||||
const CObjectVector<CHasherState> &hashers, unsigned digestIndex, bool showHash, const AString &path);
|
||||
void PrintProperty(const char *name, UInt64 value);
|
||||
|
||||
public:
|
||||
@@ -28,14 +36,17 @@ public:
|
||||
|
||||
bool PrintHeaders;
|
||||
|
||||
bool PrintSize;
|
||||
bool PrintName;
|
||||
// bool PrintSize;
|
||||
// bool PrintNewLine; // set it too (false), if you need only hash for single file without LF char.
|
||||
AString PrintFields;
|
||||
|
||||
AString GetFields() const;
|
||||
|
||||
CHashCallbackConsole():
|
||||
PrintNameInPercents(true),
|
||||
PrintHeaders(false),
|
||||
PrintSize(true),
|
||||
PrintName(true)
|
||||
PrintHeaders(false)
|
||||
// , PrintSize(true),
|
||||
// , PrintNewLine(true)
|
||||
{}
|
||||
|
||||
virtual ~CHashCallbackConsole() {}
|
||||
|
||||
@@ -505,7 +505,7 @@ static void PrintTime(char *dest, const FILETIME *ft)
|
||||
|
||||
static inline char GetHex(Byte value)
|
||||
{
|
||||
return (char)((value < 10) ? ('0' + value) : ('A' + (value - 10)));
|
||||
return (char)((value < 10) ? ('0' + value) : ('a' + (value - 10)));
|
||||
}
|
||||
|
||||
static void HexToString(char *dest, const Byte *data, UInt32 size)
|
||||
@@ -1019,7 +1019,9 @@ HRESULT Print_OpenArchive_Error(CStdOutStream &so, const CCodecs *codecs, const
|
||||
|
||||
bool CensorNode_CheckPath(const NWildcard::CCensorNode &node, const CReadArcItem &item);
|
||||
|
||||
HRESULT ListArchives(CCodecs *codecs,
|
||||
HRESULT ListArchives(
|
||||
const CListOptions &listOptions,
|
||||
CCodecs *codecs,
|
||||
const CObjectVector<COpenType> &types,
|
||||
const CIntVector &excludedFormats,
|
||||
bool stdInMode,
|
||||
@@ -1271,6 +1273,9 @@ HRESULT ListArchives(CCodecs *codecs,
|
||||
|
||||
RINOK(Archive_IsItem_Dir(archive, i, fp.IsDir));
|
||||
|
||||
if (fp.IsDir ? listOptions.ExcludeDirItems : listOptions.ExcludeFileItems)
|
||||
continue;
|
||||
|
||||
if (!allFilesAreAllowed)
|
||||
{
|
||||
if (isAltStream)
|
||||
|
||||
@@ -7,7 +7,20 @@
|
||||
|
||||
#include "../Common/LoadCodecs.h"
|
||||
|
||||
HRESULT ListArchives(CCodecs *codecs,
|
||||
struct CListOptions
|
||||
{
|
||||
bool ExcludeDirItems;
|
||||
bool ExcludeFileItems;
|
||||
|
||||
CListOptions():
|
||||
ExcludeDirItems(false),
|
||||
ExcludeFileItems(false)
|
||||
{}
|
||||
};
|
||||
|
||||
HRESULT ListArchives(
|
||||
const CListOptions &listOptions,
|
||||
CCodecs *codecs,
|
||||
const CObjectVector<COpenType> &types,
|
||||
const CIntVector &excludedFormats,
|
||||
bool stdInMode,
|
||||
@@ -15,12 +28,12 @@ HRESULT ListArchives(CCodecs *codecs,
|
||||
bool processAltStreams, bool showAltStreams,
|
||||
const NWildcard::CCensorNode &wildcardCensor,
|
||||
bool enableHeaders, bool techMode,
|
||||
#ifndef _NO_CRYPTO
|
||||
#ifndef _NO_CRYPTO
|
||||
bool &passwordEnabled, UString &password,
|
||||
#endif
|
||||
#ifndef _SFX
|
||||
#endif
|
||||
#ifndef _SFX
|
||||
const CObjectVector<CProperty> *props,
|
||||
#endif
|
||||
#endif
|
||||
UInt64 &errors,
|
||||
UInt64 &numWarnings);
|
||||
|
||||
|
||||
@@ -71,6 +71,9 @@ extern const CCodecInfo *g_Codecs[];
|
||||
extern unsigned g_NumHashers;
|
||||
extern const CHasherInfo *g_Hashers[];
|
||||
|
||||
#ifdef EXTERNAL_CODECS
|
||||
const CExternalCodecs *g_ExternalCodecs_Ptr;
|
||||
#endif
|
||||
|
||||
#if defined(PROG_VARIANT_Z)
|
||||
#define PROG_POSTFIX "z"
|
||||
@@ -859,9 +862,11 @@ int Main2(
|
||||
codecs->CaseSensitiveChange = options.CaseSensitiveChange;
|
||||
codecs->CaseSensitive = options.CaseSensitive;
|
||||
ThrowException_if_Error(codecs->Load());
|
||||
Codecs_AddHashArcHandler(codecs);
|
||||
|
||||
#ifdef EXTERNAL_CODECS
|
||||
{
|
||||
g_ExternalCodecs_Ptr = &__externalCodecs;
|
||||
UString s;
|
||||
codecs->GetCodecsErrorMessage(s);
|
||||
if (!s.IsEmpty())
|
||||
@@ -872,8 +877,7 @@ int Main2(
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool isExtractGroupCommand = options.Command.IsFromExtractGroup();
|
||||
const bool isExtractGroupCommand = options.Command.IsFromExtractGroup();
|
||||
|
||||
if (codecs->Formats.Size() == 0 &&
|
||||
(isExtractGroupCommand
|
||||
@@ -888,13 +892,15 @@ int Main2(
|
||||
throw s;
|
||||
}
|
||||
#endif
|
||||
|
||||
throw kNoFormats;
|
||||
}
|
||||
|
||||
CObjectVector<COpenType> types;
|
||||
if (!ParseOpenTypes(*codecs, options.ArcType, types))
|
||||
{
|
||||
throw kUnsupportedArcTypeMessage;
|
||||
}
|
||||
|
||||
|
||||
CIntVector excludedFormats;
|
||||
FOR_VECTOR (k, options.ExcludedArcTypes)
|
||||
@@ -903,13 +909,16 @@ int Main2(
|
||||
if (!codecs->FindFormatForArchiveType(options.ExcludedArcTypes[k], tempIndices)
|
||||
|| tempIndices.Size() != 1)
|
||||
throw kUnsupportedArcTypeMessage;
|
||||
|
||||
|
||||
|
||||
excludedFormats.AddToUniqueSorted(tempIndices[0]);
|
||||
// excludedFormats.Sort();
|
||||
}
|
||||
|
||||
|
||||
#ifdef EXTERNAL_CODECS
|
||||
if (isExtractGroupCommand
|
||||
|| options.Command.IsFromUpdateGroup()
|
||||
|| options.Command.CommandType == NCommandType::kHash
|
||||
|| options.Command.CommandType == NCommandType::kBenchmark)
|
||||
ThrowException_if_Error(__externalCodecs.Load());
|
||||
@@ -943,7 +952,7 @@ int Main2(
|
||||
|
||||
so << endl << "Formats:" << endl;
|
||||
|
||||
const char * const kArcFlags = "KSNFMGOPBELHX";
|
||||
const char * const kArcFlags = "KSNFMGOPBELHXC";
|
||||
const unsigned kNumArcFlags = (unsigned)strlen(kArcFlags);
|
||||
|
||||
for (i = 0; i < codecs->Formats.Size(); i++)
|
||||
@@ -953,7 +962,7 @@ int Main2(
|
||||
#ifdef EXTERNAL_CODECS
|
||||
PrintLibIndex(so, arc.LibIndex);
|
||||
#else
|
||||
so << " ";
|
||||
so << " ";
|
||||
#endif
|
||||
|
||||
so << (char)(arc.UpdateEnabled ? 'C' : ' ');
|
||||
@@ -989,6 +998,8 @@ int Main2(
|
||||
if (arc.SignatureOffset != 0)
|
||||
so << "offset=" << arc.SignatureOffset << ' ';
|
||||
|
||||
// so << "numSignatures = " << arc.Signatures.Size() << " ";
|
||||
|
||||
FOR_VECTOR(si, arc.Signatures)
|
||||
{
|
||||
if (si != 0)
|
||||
@@ -1030,6 +1041,7 @@ int Main2(
|
||||
|
||||
so << (char)(cod.CreateEncoder ? 'E' : ' ');
|
||||
so << (char)(cod.CreateDecoder ? 'D' : ' ');
|
||||
so << (char)(cod.IsFilter ? 'F' : ' ');
|
||||
|
||||
so << ' ';
|
||||
PrintHexId(so, cod.Id);
|
||||
@@ -1053,6 +1065,12 @@ int Main2(
|
||||
|
||||
so << (char)(codecs->GetCodec_EncoderIsAssigned(j) ? 'E' : ' ');
|
||||
so << (char)(codecs->GetCodec_DecoderIsAssigned(j) ? 'D' : ' ');
|
||||
{
|
||||
bool isFilter_Assigned;
|
||||
const bool isFilter = codecs->GetCodec_IsFilter(j, isFilter_Assigned);
|
||||
so << (char)(isFilter ? 'F' : isFilter_Assigned ? ' ' : '*');
|
||||
}
|
||||
|
||||
|
||||
so << ' ';
|
||||
UInt64 id;
|
||||
@@ -1215,6 +1233,7 @@ int Main2(
|
||||
}
|
||||
|
||||
hresultMain = Extract(
|
||||
// EXTERNAL_CODECS_VARS_L
|
||||
codecs,
|
||||
types,
|
||||
excludedFormats,
|
||||
@@ -1329,7 +1348,12 @@ int Main2(
|
||||
|
||||
// options.ExtractNtOptions.StoreAltStreams = true, if -sns[-] is not definmed
|
||||
|
||||
CListOptions lo;
|
||||
lo.ExcludeDirItems = options.Censor.ExcludeDirItems;
|
||||
lo.ExcludeFileItems = options.Censor.ExcludeFileItems;
|
||||
|
||||
hresultMain = ListArchives(
|
||||
lo,
|
||||
codecs,
|
||||
types,
|
||||
excludedFormats,
|
||||
@@ -1429,6 +1453,7 @@ int Main2(
|
||||
|
||||
callback.Init(g_StdStream, g_ErrStream, percentsStream);
|
||||
callback.PrintHeaders = options.EnableHeaders;
|
||||
callback.PrintFields = options.ListFields;
|
||||
|
||||
AString errorInfoString;
|
||||
hresultMain = HashCalc(EXTERNAL_CODECS_VARS_L
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "../../../Common/IntToString.h"
|
||||
|
||||
#include "../../../Windows/ErrorMsg.h"
|
||||
#include "../../../Windows/FileName.h"
|
||||
|
||||
#ifndef _7ZIP_ST
|
||||
#include "../../../Windows/Synchronization.h"
|
||||
@@ -470,7 +471,7 @@ HRESULT CUpdateCallbackConsole::SetRatioInfo(const UInt64 * /* inSize */, const
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
HRESULT CCallbackConsoleBase::PrintProgress(const wchar_t *name, const char *command, bool showInLog)
|
||||
HRESULT CCallbackConsoleBase::PrintProgress(const wchar_t *name, bool isDir, const char *command, bool showInLog)
|
||||
{
|
||||
MT_LOCK
|
||||
|
||||
@@ -489,6 +490,8 @@ HRESULT CCallbackConsoleBase::PrintProgress(const wchar_t *name, const char *com
|
||||
if (name)
|
||||
{
|
||||
_tempU = name;
|
||||
if (isDir)
|
||||
NWindows::NFile::NName::NormalizeDirPathPrefix(_tempU);
|
||||
_so->Normalize_UString(_tempU);
|
||||
}
|
||||
_so->PrintUString(_tempU, _tempA);
|
||||
@@ -516,7 +519,7 @@ HRESULT CCallbackConsoleBase::PrintProgress(const wchar_t *name, const char *com
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
HRESULT CUpdateCallbackConsole::GetStream(const wchar_t *name, bool /* isDir */, bool isAnti, UInt32 mode)
|
||||
HRESULT CUpdateCallbackConsole::GetStream(const wchar_t *name, bool isDir, bool isAnti, UInt32 mode)
|
||||
{
|
||||
if (StdOutMode)
|
||||
return S_OK;
|
||||
@@ -546,7 +549,7 @@ HRESULT CUpdateCallbackConsole::GetStream(const wchar_t *name, bool /* isDir */,
|
||||
s = "Reading";
|
||||
}
|
||||
|
||||
return PrintProgress(name, s, LogLevel >= requiredLevel);
|
||||
return PrintProgress(name, isDir, s, LogLevel >= requiredLevel);
|
||||
}
|
||||
|
||||
HRESULT CUpdateCallbackConsole::OpenFileError(const FString &path, DWORD systemError)
|
||||
@@ -594,7 +597,7 @@ HRESULT CUpdateCallbackConsole::ReportExtractResult(Int32 opRes, Int32 isEncrypt
|
||||
}
|
||||
|
||||
|
||||
HRESULT CUpdateCallbackConsole::ReportUpdateOpeartion(UInt32 op, const wchar_t *name, bool /* isDir */)
|
||||
HRESULT CUpdateCallbackConsole::ReportUpdateOperation(UInt32 op, const wchar_t *name, bool isDir)
|
||||
{
|
||||
// if (StdOutMode) return S_OK;
|
||||
|
||||
@@ -622,7 +625,7 @@ HRESULT CUpdateCallbackConsole::ReportUpdateOpeartion(UInt32 op, const wchar_t *
|
||||
}
|
||||
}
|
||||
|
||||
return PrintProgress(name, s, LogLevel >= requiredLevel);
|
||||
return PrintProgress(name, isDir, s, LogLevel >= requiredLevel);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -694,7 +697,7 @@ HRESULT CUpdateCallbackConsole::CryptoGetTextPassword(BSTR *password)
|
||||
COM_TRY_END
|
||||
}
|
||||
|
||||
HRESULT CUpdateCallbackConsole::ShowDeleteFile(const wchar_t *name, bool /* isDir */)
|
||||
HRESULT CUpdateCallbackConsole::ShowDeleteFile(const wchar_t *name, bool isDir)
|
||||
{
|
||||
if (StdOutMode)
|
||||
return S_OK;
|
||||
@@ -703,7 +706,7 @@ HRESULT CUpdateCallbackConsole::ShowDeleteFile(const wchar_t *name, bool /* isDi
|
||||
{
|
||||
if (!name || name[0] == 0)
|
||||
name = kEmptyFileAlias;
|
||||
return PrintProgress(name, "D", true);
|
||||
return PrintProgress(name, isDir, "D", true);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
CErrorPathCodes ScanErrors;
|
||||
UInt64 NumNonOpenFiles;
|
||||
|
||||
HRESULT PrintProgress(const wchar_t *name, const char *command, bool showInLog);
|
||||
HRESULT PrintProgress(const wchar_t *name, bool isDir, const char *command, bool showInLog);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ CFLAGS = $(CFLAGS) \
|
||||
COMMON_OBJS = \
|
||||
$O\CommandLineParser.obj \
|
||||
$O\CRC.obj \
|
||||
$O\DynLimBuf.obj \
|
||||
$O\IntToString.obj \
|
||||
$O\ListFileUtils.obj \
|
||||
$O\NewHandler.obj \
|
||||
@@ -48,6 +49,7 @@ WIN_OBJS = \
|
||||
$O\UniqBlocks.obj \
|
||||
|
||||
AR_COMMON_OBJS = \
|
||||
$O\ItemNameUtils.obj \
|
||||
$O\OutStreamWithCRC.obj \
|
||||
|
||||
COMPRESS_OBJS = \
|
||||
|
||||
@@ -100,6 +100,7 @@ COMMON_OBJS = \
|
||||
$O/CommandLineParser.o \
|
||||
$O/CRC.o \
|
||||
$O/CrcReg.o \
|
||||
$O/DynLimBuf.o \
|
||||
$O/IntToString.o \
|
||||
$O/ListFileUtils.o \
|
||||
$O/NewHandler.o \
|
||||
@@ -148,6 +149,9 @@ WIN_OBJS = \
|
||||
COMPRESS_OBJS = \
|
||||
$O/CopyCoder.o \
|
||||
|
||||
AR_COMMON_OBJS = \
|
||||
$O/ItemNameUtils.o \
|
||||
|
||||
C_OBJS = \
|
||||
$O/Alloc.o \
|
||||
$O/CpuArch.o \
|
||||
@@ -163,6 +167,7 @@ OBJS = \
|
||||
$(WIN_OBJS) \
|
||||
$(SYS_OBJS) \
|
||||
$(COMPRESS_OBJS) \
|
||||
$(AR_COMMON_OBJS) \
|
||||
$(7ZIP_COMMON_OBJS) \
|
||||
$(UI_COMMON_OBJS) \
|
||||
$(CONSOLE_OBJS) \
|
||||
|
||||
Reference in New Issue
Block a user