@@ -46,22 +46,19 @@ class Printer {
4646
4747 static void print_table (std::ostream &stream, TableInternal &table);
4848
49- static void
50- print_row_in_cell (std::ostream &stream, TableInternal &table,
51- const std::pair<size_t , size_t > &index,
52- const std::pair<size_t , size_t > &dimension,
53- size_t num_columns, size_t row_index,
54- const std::vector<std::string> &splitted_cell_text);
49+ static void print_row_in_cell (std::ostream &stream, TableInternal &table,
50+ const std::pair<size_t , size_t > &index,
51+ const std::pair<size_t , size_t > &dimension, size_t num_columns,
52+ size_t row_index,
53+ const std::vector<std::string> &splitted_cell_text);
5554
5655 static bool print_cell_border_top (std::ostream &stream, TableInternal &table,
5756 const std::pair<size_t , size_t > &index,
58- const std::pair<size_t , size_t > &dimension,
59- size_t num_columns);
60- static bool
61- print_cell_border_bottom (std::ostream &stream, TableInternal &table,
62- const std::pair<size_t , size_t > &index,
63- const std::pair<size_t , size_t > &dimension,
64- size_t num_columns);
57+ const std::pair<size_t , size_t > &dimension, size_t num_columns);
58+ static bool print_cell_border_bottom (std::ostream &stream, TableInternal &table,
59+ const std::pair<size_t , size_t > &index,
60+ const std::pair<size_t , size_t > &dimension,
61+ size_t num_columns);
6562
6663 static void apply_element_style (std::ostream &stream, Color foreground_color,
6764 Color background_color,
@@ -72,26 +69,21 @@ class Printer {
7269 apply_font_style (stream, style);
7370 }
7471
75- static void reset_element_style (std::ostream &stream) {
76- stream << termcolor::reset;
77- }
72+ static void reset_element_style (std::ostream &stream) { stream << termcolor::reset; }
7873
7974private:
80- static void print_content_left_aligned (std::ostream &stream,
81- const std::string &cell_content,
82- const Format &format,
83- size_t text_with_padding_size,
75+ static void print_content_left_aligned (std::ostream &stream, const std::string &cell_content,
76+ const Format &format, size_t text_with_padding_size,
8477 size_t column_width) {
8578
8679 // Apply font style
87- apply_element_style (stream, *format.font_color_ ,
88- *format.font_background_color_ , *format. font_style_ );
80+ apply_element_style (stream, *format.font_color_ , *format. font_background_color_ ,
81+ *format.font_style_ );
8982 stream << cell_content;
9083 // Only apply font_style to the font
9184 // Not the padding. So calling apply_element_style with font_style = {}
9285 reset_element_style (stream);
93- apply_element_style (stream, *format.font_color_ ,
94- *format.font_background_color_ , {});
86+ apply_element_style (stream, *format.font_color_ , *format.font_background_color_ , {});
9587
9688 if (text_with_padding_size < column_width) {
9789 for (size_t j = 0 ; j < (column_width - text_with_padding_size); ++j) {
@@ -100,10 +92,8 @@ class Printer {
10092 }
10193 }
10294
103- static void print_content_center_aligned (std::ostream &stream,
104- const std::string &cell_content,
105- const Format &format,
106- size_t text_with_padding_size,
95+ static void print_content_center_aligned (std::ostream &stream, const std::string &cell_content,
96+ const Format &format, size_t text_with_padding_size,
10797 size_t column_width) {
10898 auto num_spaces = column_width - text_with_padding_size;
10999 if (num_spaces % 2 == 0 ) {
@@ -112,14 +102,13 @@ class Printer {
112102 stream << " " ;
113103
114104 // Apply font style
115- apply_element_style (stream, *format.font_color_ ,
116- *format.font_background_color_ , *format. font_style_ );
105+ apply_element_style (stream, *format.font_color_ , *format. font_background_color_ ,
106+ *format.font_style_ );
117107 stream << cell_content;
118108 // Only apply font_style to the font
119109 // Not the padding. So calling apply_element_style with font_style = {}
120110 reset_element_style (stream);
121- apply_element_style (stream, *format.font_color_ ,
122- *format.font_background_color_ , {});
111+ apply_element_style (stream, *format.font_color_ , *format.font_background_color_ , {});
123112
124113 for (size_t j = 0 ; j < num_spaces / 2 ; ++j)
125114 stream << " " ;
@@ -129,24 +118,21 @@ class Printer {
129118 stream << " " ;
130119
131120 // Apply font style
132- apply_element_style (stream, *format.font_color_ ,
133- *format.font_background_color_ , *format. font_style_ );
121+ apply_element_style (stream, *format.font_color_ , *format. font_background_color_ ,
122+ *format.font_style_ );
134123 stream << cell_content;
135124 // Only apply font_style to the font
136125 // Not the padding. So calling apply_element_style with font_style = {}
137126 reset_element_style (stream);
138- apply_element_style (stream, *format.font_color_ ,
139- *format.font_background_color_ , {});
127+ apply_element_style (stream, *format.font_color_ , *format.font_background_color_ , {});
140128
141129 for (size_t j = 0 ; j < num_spaces - num_spaces_before; ++j)
142130 stream << " " ;
143131 }
144132 }
145133
146- static void print_content_right_aligned (std::ostream &stream,
147- const std::string &cell_content,
148- const Format &format,
149- size_t text_with_padding_size,
134+ static void print_content_right_aligned (std::ostream &stream, const std::string &cell_content,
135+ const Format &format, size_t text_with_padding_size,
150136 size_t column_width) {
151137 if (text_with_padding_size < column_width) {
152138 for (size_t j = 0 ; j < (column_width - text_with_padding_size); ++j) {
@@ -155,14 +141,13 @@ class Printer {
155141 }
156142
157143 // Apply font style
158- apply_element_style (stream, *format.font_color_ ,
159- *format.font_background_color_ , *format. font_style_ );
144+ apply_element_style (stream, *format.font_color_ , *format. font_background_color_ ,
145+ *format.font_style_ );
160146 stream << cell_content;
161147 // Only apply font_style to the font
162148 // Not the padding. So calling apply_element_style with font_style = {}
163149 reset_element_style (stream);
164- apply_element_style (stream, *format.font_color_ ,
165- *format.font_background_color_ , {});
150+ apply_element_style (stream, *format.font_color_ , *format.font_background_color_ , {});
166151 }
167152
168153 static void apply_font_style (std::ostream &stream, FontStyle style) {
@@ -196,8 +181,7 @@ class Printer {
196181 }
197182 }
198183
199- static void apply_foreground_color (std::ostream &stream,
200- Color foreground_color) {
184+ static void apply_foreground_color (std::ostream &stream, Color foreground_color) {
201185 switch (foreground_color) {
202186 case Color::grey:
203187 stream << termcolor::grey;
@@ -229,8 +213,7 @@ class Printer {
229213 }
230214 }
231215
232- static void apply_background_color (std::ostream &stream,
233- Color background_color) {
216+ static void apply_background_color (std::ostream &stream, Color background_color) {
234217 switch (background_color) {
235218 case Color::grey:
236219 stream << termcolor::on_grey;
0 commit comments