Split things up a bit.
Also start approximating the look and feel
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user