| 1628 | |
| 1629 | template <typename Char, typename Handler> |
| 1630 | FMT_CONSTEXPR void parse_format_string(basic_string_view<Char> fmt, |
| 1631 | Handler&& handler) { |
| 1632 | auto begin = fmt.data(), end = begin + fmt.size(); |
| 1633 | auto p = begin; |
| 1634 | while (p != end) { |
| 1635 | auto c = *p++; |
| 1636 | if (c == '{') { |
| 1637 | handler.on_text(begin, p - 1); |
| 1638 | begin = p = parse_replacement_field(p - 1, end, handler); |
| 1639 | } else if (c == '}') { |
| 1640 | if (p == end || *p != '}') |
| 1641 | return handler.on_error("unmatched '}' in format string"); |
| 1642 | handler.on_text(begin, p); |
| 1643 | begin = ++p; |
| 1644 | } |
| 1645 | } |
| 1646 | handler.on_text(begin, end); |
| 1647 | } |
| 1648 | |
| 1649 | // Checks char specs and returns true iff the presentation type is char-like. |
| 1650 | FMT_CONSTEXPR inline auto check_char_specs(const format_specs& specs) -> bool { |