1 #ifndef _utl_TabularStream_h_
2 #define _utl_TabularStream_h_
10 #include <utl/ErrorLogger.h>
36 std::string
GetEntry(
const int left = 0,
const int right = 0)
const
37 {
return std::string(left,
' ') +
fEntry.str() + std::string(right,
' '); }
40 const int leftSize = 0,
const char mid =
'\0')
const;
44 std::pair<int, int>
GetSize(
const char mid)
const;
62 {
Front() << junk;
return *
this; }
67 const std::string& postfix = std::string())
199 void Clear(
const std::string& format)
222 *
this <<
"ERROR: hline can be used only at the begining of a new line";
224 for (Columns::iterator cIt =
fColumns.begin();
226 *cIt << ((std::string(
"\r") + hl.
GetChar()));
235 for (Columns::iterator cIt =
fColumns.begin();
261 ERROR(
"Running out of columns, will fill the last one!");
269 for (Columns::iterator cIt =
fColumns.begin();
287 return os << ts.
Str();
Holds TabularStream cell entry.
TabularStream & operator<<(const EndColumn)
TabularStream(const std::string &format)
TableCell & operator=(const TableCell &c)
void SetMargins(const std::string &prefix, const std::string &postfix=std::string())
std::vector< TableColumn > Columns
std::deque< TableCell > fCells
type-only supplying class that triggers end-of-column in the TabularStream
Stream & operator<<(Stream &s, MessageLoggerConfig &mlc)
Applies the configuration to the given stream.
Columns::iterator fCurrentColumn
TableColumn & operator<<(const T &junk)
class that triggers insertion of the line row in the TabularStream
TabularStream & operator<<(const EndRow)
std::ostringstream fEntry
class to format data in tabular form
void Clear(const std::string &format)
std::string GetEntry(const int left=0, const int right=0) const
void SetJustification(const TableCell::Justification just, const char mid= '\0')
TableCell & operator<<(const T &item)
TabularStream & operator<<(const T &junk)
void MakeFormat(const std::string &format)
#define ERROR(message)
Macro for logging error messages.
type-only supplying class that triggers end-of-row in the TabularStream
TableCell::Justification fJustification
TableCell(const TableCell &c)