4.49 beta

This commit is contained in:
Igor Pavlov
2007-07-11 00:00:00 +00:00
committed by Kornel Lesiński
parent fd8b1d78b4
commit 7038848692
44 changed files with 1600 additions and 220 deletions

View File

@@ -69,6 +69,7 @@ static const char kArchiveAttributeChar = 'A';
static const char *kListing = "Listing archive: ";
static const wchar_t *kFilesMessage = L"files";
static const wchar_t *kDirsMessage = L"folders";
static void GetAttributesString(DWORD wa, bool directory, char *s)
{
@@ -118,7 +119,7 @@ CFieldInfoInit kStandardFieldTable[] =
{ kpidAttributes, L"Attr", kRight, kCenter, 1, 5 },
{ kpidSize, L"Size", kRight, kRight, 1, 12 },
{ kpidPackedSize, L"Compressed", kRight, kRight, 1, 12 },
{ kpidPath, L"Name", kLeft, kLeft, 2, 12 }
{ kpidPath, L"Name", kLeft, kLeft, 2, 24 }
};
void PrintSpaces(int numSpaces)
@@ -162,8 +163,8 @@ public:
const NWindows::NFile::NFind::CFileInfoW &archiveFileInfo,
UInt32 index,
bool techMode);
HRESULT PrintSummaryInfo(UInt64 numFiles, const UInt64 *size,
const UInt64 *compressedSize);
HRESULT PrintSummaryInfo(UInt64 numFiles, UInt64 numDirs,
const UInt64 *size, const UInt64 *compressedSize);
};
void CFieldPrinter::Init(const CFieldInfoInit *standardFieldTable, int numItems)
@@ -354,7 +355,7 @@ void PrintNumberString(EAdjustment adjustment, int width, const UInt64 *value)
}
HRESULT CFieldPrinter::PrintSummaryInfo(UInt64 numFiles,
HRESULT CFieldPrinter::PrintSummaryInfo(UInt64 numFiles, UInt64 numDirs,
const UInt64 *size, const UInt64 *compressedSize)
{
for (int i = 0; i < _fields.Size(); i++)
@@ -373,6 +374,11 @@ HRESULT CFieldPrinter::PrintSummaryInfo(UInt64 numFiles,
UString temp = textString;
temp += L" ";
temp += kFilesMessage;
temp += L", ";
ConvertUInt64ToString(numDirs, textString);
temp += textString;
temp += L" ";
temp += kDirsMessage;
PrintString(fieldInfo.TextAdjustment, 0, temp);
}
else
@@ -403,7 +409,7 @@ HRESULT ListArchives(
if (!techMode)
fieldPrinter.Init(kStandardFieldTable, sizeof(kStandardFieldTable) / sizeof(kStandardFieldTable[0]));
UInt64 numFiles2 = 0, totalPackSize2 = 0, totalUnPackSize2 = 0;
UInt64 numFiles2 = 0, numDirs2 = 0, totalPackSize2 = 0, totalUnPackSize2 = 0;
UInt64 *totalPackSizePointer2 = 0, *totalUnPackSizePointer2 = 0;
for (int i = 0; i < archivePaths.Size(); i++)
{
@@ -465,7 +471,7 @@ HRESULT ListArchives(
{
RINOK(fieldPrinter.Init(archive));
}
UInt64 numFiles = 0, totalPackSize = 0, totalUnPackSize = 0;
UInt64 numFiles = 0, numDirs = 0, totalPackSize = 0, totalUnPackSize = 0;
UInt64 *totalPackSizePointer = 0, *totalUnPackSizePointer = 0;
UInt32 numItems;
RINOK(archive->GetNumberOfItems(&numItems));
@@ -495,8 +501,11 @@ HRESULT ListArchives(
totalPackSizePointer = &totalPackSize;
g_StdOut << endl;
numFiles++;
if (isFolder)
numDirs++;
else
numFiles++;
totalPackSize += packSize;
totalUnPackSize += unpackSize;
}
@@ -504,7 +513,7 @@ HRESULT ListArchives(
{
fieldPrinter.PrintTitleLines();
g_StdOut << endl;
fieldPrinter.PrintSummaryInfo(numFiles, totalUnPackSizePointer, totalPackSizePointer);
fieldPrinter.PrintSummaryInfo(numFiles, numDirs, totalUnPackSizePointer, totalPackSizePointer);
g_StdOut << endl;
}
if (totalPackSizePointer != 0)
@@ -518,13 +527,14 @@ HRESULT ListArchives(
totalUnPackSize2 += totalUnPackSize;
}
numFiles2 += numFiles;
numDirs2 += numDirs;
}
if (enableHeaders && !techMode && archivePaths.Size() > 1)
{
g_StdOut << endl;
fieldPrinter.PrintTitleLines();
g_StdOut << endl;
fieldPrinter.PrintSummaryInfo(numFiles2, totalUnPackSizePointer2, totalPackSizePointer2);
fieldPrinter.PrintSummaryInfo(numFiles2, numDirs2, totalUnPackSizePointer2, totalPackSizePointer2);
g_StdOut << endl;
g_StdOut << "Archives: " << archivePaths.Size() << endl;
}