MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / format

Method format

extlibs/fmt/include/fmt/format.h:3086–3112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3084
3085 template <typename T, typename FormatContext>
3086 auto format(const T& val, FormatContext& ctx) -> decltype(ctx.out()) {
3087 handle_specs(ctx);
3088 internal::specs_checker<null_handler> checker(
3089 null_handler(),
3090 internal::mapped_type_constant<T, FormatContext>::value);
3091 checker.on_align(specs_.align);
3092 switch (specs_.sign) {
3093 case sign::none:
3094 break;
3095 case sign::plus:
3096 checker.on_plus();
3097 break;
3098 case sign::minus:
3099 checker.on_minus();
3100 break;
3101 case sign::space:
3102 checker.on_space();
3103 break;
3104 }
3105 if (specs_.alt) checker.on_hash();
3106 if (specs_.precision >= 0) checker.end_precision();
3107 using range = internal::output_range<typename FormatContext::iterator,
3108 typename FormatContext::char_type>;
3109 visit_format_arg(arg_formatter<range>(ctx, nullptr, &specs_),
3110 internal::make_arg<FormatContext>(val));
3111 return ctx.out();
3112 }
3113
3114 private:
3115 template <typename Context> void handle_specs(Context& ctx) {

Callers

nothing calls this directly

Calls 9

null_handlerClass · 0.85
visit_format_argFunction · 0.85
outMethod · 0.45
on_alignMethod · 0.45
on_plusMethod · 0.45
on_minusMethod · 0.45
on_spaceMethod · 0.45
on_hashMethod · 0.45
end_precisionMethod · 0.45

Tested by

no test coverage detected