Skip to content

Commit

Permalink
C4Group::View: Reintroduce filename right alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Fulgen301 committed Jun 29, 2024
1 parent 60e10d0 commit 47db48f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/C4Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,7 @@ bool C4Group::View(const char *szFiles)
{
C4GroupEntry *centry;
int fcount = 0, bcount = 0; // Virtual counts
std::size_t maxFilenameLength{0};

if (!StdOutput) return false;

Expand All @@ -1373,6 +1374,7 @@ bool C4Group::View(const char *szFiles)
{
fcount++;
bcount += centry->Size;
maxFilenameLength = std::max(maxFilenameLength, std::strlen(centry->FileName));
}

std::println("Maker: {} Creation: {} {}\n\rVersion: {}.{} CRC: {} ({:X})",
Expand All @@ -1391,7 +1393,7 @@ bool C4Group::View(const char *szFiles)
if (pcoretm) coretm = *pcoretm; else std::print("(invalid timestamp) ");
centry->Time = static_cast<int32_t>(cur_time);

std::println("{} {:8} Bytes {:02}.{:02}.{:02} {:02}:{:02}:{:02} {}{:08X} {}", centry->FileName,
std::println("{:>{}} {:8} Bytes {:02}.{:02}.{:02} {:02}:{:02}:{:02} {}{:08X} {}", centry->FileName, maxFilenameLength,
centry->Size,
coretm.tm_mday, coretm.tm_mon + 1, coretm.tm_year % 100,
coretm.tm_hour, coretm.tm_min, coretm.tm_sec,
Expand Down

0 comments on commit 47db48f

Please sign in to comment.