Lines Matching full: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(); in override_column_widths() local
62 // Override the actual width of the columns based on user-specified widths. in override_column_widths()
67 user_width >= widths[i], in override_column_widths()
68 "User-provided column widths must be larger than the " in override_column_widths()
70 widths[i] = user_width; in override_column_widths()
74 return widths; in override_column_widths()
80 /// \param widths The widths of the columns as returned by
87 find_refill_column(const text::widths_vector& widths) in find_refill_column() argument
90 for (; i < widths.size(); ++i) { in find_refill_column()
91 if (widths[i] == text::table_formatter::width_refill) in find_refill_column()
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, in refill_widths() argument
118 // widths.size() is a proxy for the number of columns of the table. in refill_widths()
119 const std::size_t total_padding = column_padding * (widths.size() - 1); in refill_widths()
124 find_refill_column(widths); in refill_widths()
125 INV(refill_column < widths.size()); in refill_widths()
128 for (text::widths_vector::size_type i = 0; i < widths.size(); ++i) { in refill_widths()
130 width += widths[i]; in refill_widths()
132 widths[refill_column] = max_width - width; in refill_widths()
165 /// \param widths The widths of the row.
171 refill_cell(const text::table_row& row, const text::widths_vector& widths, in refill_cell() argument
176 widths[column]); in refill_cell()
185 textual_rows[i][j] = pad_cell(rows[i], widths[j], is_last); in refill_cell()
188 textual_rows[i][j] = pad_cell("", widths[j], is_last); in refill_cell()
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, in format_row() argument
208 PRE(row.size() == widths.size()); in format_row()
213 if (widths[column] > row[column].length()) in format_row()
214 textual_rows[0][column] = pad_cell(row[column], widths[column], in format_row()
217 refill_cell(row, widths, column, textual_rows); in format_row()
269 /// Gets the widths of all columns.
415 widths_vector widths = override_column_widths(t, _column_widths); in format() local
417 refill_widths(widths, _table_width, _separator.length()); in format()
421 format_row(*iter, widths, _separator); in format()