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

Function parse_format_string

include/fmt/base.h:1629–1646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 6

parse_stringFunction · 0.85
vscanFunction · 0.85
vformat_toFunction · 0.85
strMethod · 0.85
vformat_toFunction · 0.85
str_Method · 0.85

Calls 5

parse_replacement_fieldFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45
on_textMethod · 0.45
on_errorMethod · 0.45

Tested by 1

parse_stringFunction · 0.68