MCPcopy Create free account
hub / github.com/p-ranav/tabulate / shape

Method shape

include/tabulate/table_internal.hpp:96–106  ·  view source on GitHub ↗

{rendered width in characters, rendered height in lines} of the printed table -- NOT the number of data rows/columns. See Table::dimensions() for that.

Source from the content-addressed store, hash-verified

94 // table -- NOT the number of data rows/columns. See Table::dimensions()
95 // for that.
96 std::pair<size_t, size_t> shape() {
97 std::pair<size_t, size_t> result{0, 0};
98 std::stringstream stream;
99 print(stream);
100 auto buffer = stream.str();
101 auto lines = Format::split_lines(buffer, "\n", "", true);
102 if (lines.size()) {
103 result = {get_sequence_length(lines[0], "", true), lines.size()};
104 }
105 return result;
106 }
107
108 Format &format() { return format_; }
109

Callers

nothing calls this directly

Calls 3

get_sequence_lengthFunction · 0.70
strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected