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

Method on_format_specs

include/fmt/format.h:3808–3826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3806 }
3807
3808 auto on_format_specs(int id, const Char* begin, const Char* end)
3809 -> const Char* {
3810 auto arg = ctx.arg(id);
3811 if (!arg) report_error("argument not found");
3812 // Not using a visitor for custom types gives better codegen.
3813 if (arg.format_custom(begin, parse_ctx, ctx)) return parse_ctx.begin();
3814
3815 auto specs = dynamic_format_specs<Char>();
3816 begin = parse_format_specs(begin, end, specs, parse_ctx, arg.type());
3817 if (specs.dynamic()) {
3818 handle_dynamic_spec(specs.dynamic_width(), specs.width, specs.width_ref,
3819 ctx);
3820 handle_dynamic_spec(specs.dynamic_precision(), specs.precision,
3821 specs.precision_ref, ctx);
3822 }
3823
3824 arg.visit(arg_formatter<Char>{ctx.out(), specs, ctx.locale()});
3825 return begin;
3826 }
3827
3828 FMT_NORETURN void on_error(const char* message) { report_error(message); }
3829};

Callers 1

parse_replacement_fieldFunction · 0.45

Calls 12

report_errorFunction · 0.85
parse_format_specsFunction · 0.85
dynamicMethod · 0.80
dynamic_widthMethod · 0.80
dynamic_precisionMethod · 0.80
localeMethod · 0.80
argMethod · 0.45
format_customMethod · 0.45
beginMethod · 0.45
typeMethod · 0.45
visitMethod · 0.45
outMethod · 0.45

Tested by

no test coverage detected