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

Function parse_format_specs

extlibs/fmt/include/fmt/format.h:2497–2543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2495// components to handler.
2496template <typename Char, typename SpecHandler>
2497FMT_CONSTEXPR const Char* parse_format_specs(const Char* begin, const Char* end,
2498 SpecHandler&& handler) {
2499 if (begin == end || *begin == '}') return begin;
2500
2501 begin = parse_align(begin, end, handler);
2502 if (begin == end) return begin;
2503
2504 // Parse sign.
2505 switch (static_cast<char>(*begin)) {
2506 case '+':
2507 handler.on_plus();
2508 ++begin;
2509 break;
2510 case '-':
2511 handler.on_minus();
2512 ++begin;
2513 break;
2514 case ' ':
2515 handler.on_space();
2516 ++begin;
2517 break;
2518 }
2519 if (begin == end) return begin;
2520
2521 if (*begin == '#') {
2522 handler.on_hash();
2523 if (++begin == end) return begin;
2524 }
2525
2526 // Parse zero flag.
2527 if (*begin == '0') {
2528 handler.on_zero();
2529 if (++begin == end) return begin;
2530 }
2531
2532 begin = parse_width(begin, end, handler);
2533 if (begin == end) return begin;
2534
2535 // Parse precision.
2536 if (*begin == '.') {
2537 begin = parse_precision(begin, end, handler);
2538 }
2539
2540 // Parse type.
2541 if (begin != end && *begin != '}') handler.on_type(*begin++);
2542 return begin;
2543}
2544
2545// Return the result via the out param to workaround gcc bug 77539.
2546template <bool IS_CONSTEXPR, typename T, typename Ptr = const T*>

Callers 5

parseMethod · 0.85
parseMethod · 0.85
on_format_specsMethod · 0.85
parseMethod · 0.85
on_format_specsMethod · 0.85

Calls 11

parse_alignFunction · 0.85
parse_widthFunction · 0.85
parse_precisionFunction · 0.85
on_typeMethod · 0.80
on_plusMethod · 0.45
on_minusMethod · 0.45
on_spaceMethod · 0.45
on_hashMethod · 0.45
on_zeroMethod · 0.45
mapMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected