| 1 |
#include "tabletype.ih" |
| 2 |
|
| 3 |
ostream &TableType::insert(ostream &ostr) const |
| 4 |
{ |
| 5 |
if (!d_nRows) |
| 6 |
return ostr; |
| 7 |
|
| 8 |
d_tableSupport.setParam(ostr, d_nRows, d_colWidth, |
| 9 |
d_widthType == EQUALWIDTH ? d_maxWidth : 0); |
| 10 |
|
| 11 |
for (size_t row = 0; row < d_nRows; row++) |
| 12 |
{ |
| 13 |
d_tableSupport.hline(row); |
| 14 |
|
| 15 |
for (size_t col = 0; col < d_nColumns; col++) |
| 16 |
{ |
| 17 |
size_t colwidth = width(col); |
| 18 |
|
| 19 |
d_tableSupport.vline(col); |
| 20 |
ostr << setw(colwidth) << stringAt(row, col); |
| 21 |
} |
| 22 |
|
| 23 |
d_tableSupport.vline(); |
| 24 |
} |
| 25 |
d_tableSupport.hline(); |
| 26 |
|
| 27 |
return ostr; |
| 28 |
} |