37 for (
Size i = rows.
size(); i <= rowIdx; ++i) {
42 for (
Row& row : rows) {
43 row.resize(colIdx + 1);
46 rows[rowIdx][colIdx] = std::move(text);
64 for (
const Row& row : rows) {
65 for (
Size colIdx = 0; colIdx < row.size(); ++colIdx) {
66 colWidths[colIdx] =
max(colWidths[colIdx],
Size(row[colIdx].size()));
69 for (
Size colIdx = 0; colIdx < rows[0].size(); ++colIdx) {
70 colWidths[colIdx] =
max(colWidths[colIdx] + params.colSep, params.minColWidth);
73 for (
const Row& row : rows) {
74 for (
Size colIdx = 0; colIdx < row.size(); ++colIdx) {
75 ss << std::setw(colWidths[colIdx]) << row[colIdx];
Generic dynamically allocated resizable storage.
uint32_t Size
Integral type used to index arrays (by default).
constexpr INLINE T max(const T &f1, const T &f2)
#define NAMESPACE_SPH_END
StorageType & emplaceBack(TArgs &&... args)
Constructs a new element at the end of the array in place, using the provided arguments.
void fill(const T &t)
Sets all elements of the array to given value.
INLINE TCounter size() const noexcept
INLINE bool empty() const noexcept
Table(const Size colSep=1, const Size minColWidth=5)
Creates an empty table.
std::string toString() const
Creates the text representation of the table.
void setCell(const Size colIdx, const Size rowIdx, std::string text)
Sets the text in given cell.