| 2495 | // components to handler. |
| 2496 | template <typename Char, typename SpecHandler> |
| 2497 | FMT_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. |
| 2546 | template <bool IS_CONSTEXPR, typename T, typename Ptr = const T*> |
no test coverage detected