MCPcopy Create free account
hub / github.com/fmtlib/fmt / write_padded

Method write_padded

include/fmt/format.h:4131–4141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4129
4130 template <typename FormatContext, typename F>
4131 auto write_padded(FormatContext& ctx, F write) const -> decltype(ctx.out()) {
4132 if (width_ == 0) return write(ctx.out());
4133 auto buf = basic_memory_buffer<Char>();
4134 write(basic_appender<Char>(buf));
4135 auto specs = format_specs();
4136 specs.width = width_;
4137 specs.copy_fill_from(specs_);
4138 specs.set_align(specs_.align());
4139 return detail::write<Char>(
4140 ctx.out(), basic_string_view<Char>(buf.data(), buf.size()), specs);
4141 }
4142
4143 auto nested(const T& value) const -> nested_view<T, Char> {
4144 return nested_view<T, Char>{&formatter_, &value};

Callers 1

formatMethod · 0.80

Calls 8

format_specsClass · 0.85
copy_fill_fromMethod · 0.80
set_alignMethod · 0.80
writeFunction · 0.70
outMethod · 0.45
alignMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected