Lines Matching defs:widths

45 /// Applies user overrides to the column widths of a table.
47 /// \param table The table from which to calculate the column widths.
48 /// \param user_widths The column widths provided by the user. This vector must
51 /// to the output widths vector, including width_refill.
53 /// \return A vector with the widths of the columns of the input table with any
60 text::widths_vector widths = table.column_widths();
62 // Override the actual width of the columns based on user-specified widths.
67 user_width >= widths[i],
68 "User-provided column widths must be larger than the "
70 widths[i] = user_width;
74 return widths;
80 /// \param widths The widths of the columns as returned by
87 find_refill_column(const text::widths_vector& widths)
90 for (; i < widths.size(); ++i) {
91 if (widths[i] == text::table_formatter::width_refill)
98 /// Pads the widths of the table to fit within a maximum width.
100 /// On output, a column of the widths vector is truncated to a shorter length
104 /// \param [in,out] widths The widths of the columns as returned by
112 refill_widths(text::widths_vector& widths,
118 // widths.size() is a proxy for the number of columns of the table.
119 const std::size_t total_padding = column_padding * (widths.size() - 1);
124 find_refill_column(widths);
125 INV(refill_column < widths.size());
128 for (text::widths_vector::size_type i = 0; i < widths.size(); ++i) {
130 width += widths[i];
132 widths[refill_column] = max_width - width;
165 /// \param widths The widths of the row.
171 refill_cell(const text::table_row& row, const text::widths_vector& widths,
176 widths[column]);
185 textual_rows[i][j] = pad_cell(rows[i], widths[j], is_last);
188 textual_rows[i][j] = pad_cell("", widths[j], is_last);
198 /// \param widths The widths of the columns to apply during formatting. Cells
205 format_row(const text::table_row& row, const text::widths_vector& widths,
208 PRE(row.size() == widths.size());
213 if (widths[column] > row[column].length())
214 textual_rows[0][column] = pad_cell(row[column], widths[column],
217 refill_cell(row, widths, column, textual_rows);
269 /// Gets the widths of all columns.
415 widths_vector widths = override_column_widths(t, _column_widths);
417 refill_widths(widths, _table_width, _separator.length());
421 format_row(*iter, widths, _separator);