Split things up a bit.

Also start approximating the look and feel
This commit is contained in:
2026-05-20 22:32:42 -04:00
parent 82ca0de82d
commit 2c39765a4d
5 changed files with 130 additions and 67 deletions
+24
View File
@@ -0,0 +1,24 @@
#include "Entry.h"
#include <sstream>
#include <iostream>
std::string
format_entry( const Entry &entry, const std::size_t widest )
{
std::ostringstream oss;
oss << "[";
if( entry.is_dir )
{
oss << "1;35;95";
}
else if( entry.is_exe )
{
oss << "1;36;96";
}
oss << 'm' << std::setw( widest + 8 ) << std::left << entry.name;
return std::move( oss ).str();
}