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

Method print_content_left_aligned

include/tabulate/printer.hpp:75–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74private:
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,
77 size_t column_width) {
78
79 // Apply font style
80 apply_element_style(stream, *format.font_color_, *format.font_background_color_,
81 *format.font_style_);
82 stream << cell_content;
83 // Only apply font_style to the font
84 // Not the padding. So calling apply_element_style with font_style = {}
85 reset_element_style(stream);
86 apply_element_style(stream, *format.font_color_, *format.font_background_color_, {});
87
88 if (text_with_padding_size < column_width) {
89 for (size_t j = 0; j < (column_width - text_with_padding_size); ++j) {
90 stream << " ";
91 }
92 }
93 }
94
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,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected