1 #ifndef ROSE_FormattedTable_H
2 #define ROSE_FormattedTable_H
4 #include <Rose/Color.h>
5 #include <boost/lexical_cast.hpp>
88 std::vector<std::vector<std::string>> cells_;
89 std::vector<std::vector<CellProperties>> props_;
90 std::vector<std::vector<std::string>> columnHeaders_;
91 std::vector<std::vector<CellProperties>> columnHeaderProps_;
92 std::string indentation_;
148 size_t nRows()
const;
158 void insert(
size_t rowIdx,
size_t columnIdx,
const std::string &repr);
160 template<
typename T>
void insert(
size_t rowIdx,
size_t columnIdx,
const T &value) {
161 insert(rowIdx, columnIdx, boost::lexical_cast<std::string>(value));
163 template<
typename T>
void insert(
size_t rowIdx,
size_t columnIdx,
const T &value,
const CellProperties &prop) {
164 insert(rowIdx, columnIdx, boost::lexical_cast<std::string>(value), prop);
169 const std::string&
get(
size_t rowIdx,
size_t colIdx)
const;
176 const CellProperties&
cellProperties(
size_t rowIdx,
size_t columnIdx)
const;
177 void cellProperties(
size_t rowIdx,
size_t columnIdx,
const CellProperties&);
201 const std::string&
columnHeader(
size_t rowIdx,
size_t columnIdx)
const;
202 void columnHeader(
size_t rowIdx,
size_t columnIdx,
const std::string &title);
220 void print(std::ostream&)
const;
223 std::string cellPropertiesBegin(
const CellProperties&)
const;
224 std::string cellPropertiesEnd(
const CellProperties&)
const;
225 void printHorizontalRule(std::ostream&,
const std::vector<size_t> &widths)
const;
226 void printRow(std::ostream&,
const std::vector<size_t> &widths,
const std::vector<CellProperties> &props,
227 const std::vector<std::string> &row)
const;
228 std::vector<size_t> computeColumnWidths()
const;
Holds a value or nothing.
Main namespace for the ROSE library.