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

Method parse_header

extlibs/fmt/include/fmt/printf.h:414–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412
413template <typename OutputIt, typename Char>
414int basic_printf_context<OutputIt, Char>::parse_header(const Char*& it,
415 const Char* end,
416 format_specs& specs) {
417 int arg_index = -1;
418 char_type c = *it;
419 if (c >= '0' && c <= '9') {
420 // Parse an argument index (if followed by '$') or a width possibly
421 // preceded with '0' flag(s).
422 internal::error_handler eh;
423 int value = parse_nonnegative_int(it, end, eh);
424 if (it != end && *it == '$') { // value is an argument index
425 ++it;
426 arg_index = value;
427 } else {
428 if (c == '0') specs.fill[0] = '0';
429 if (value != 0) {
430 // Nonzero value means that we parsed width and don't need to
431 // parse it or flags again, so return now.
432 specs.width = value;
433 return arg_index;
434 }
435 }
436 }
437 parse_flags(specs, it, end);
438 // Parse width.
439 if (it != end) {
440 if (*it >= '0' && *it <= '9') {
441 internal::error_handler eh;
442 specs.width = parse_nonnegative_int(it, end, eh);
443 } else if (*it == '*') {
444 ++it;
445 specs.width = static_cast<int>(visit_format_arg(
446 internal::printf_width_handler<char_type>(specs), get_arg()));
447 }
448 }
449 return arg_index;
450}
451
452template <typename OutputIt, typename Char>
453template <typename ArgFormatter>

Callers

nothing calls this directly

Calls 2

parse_nonnegative_intFunction · 0.85
visit_format_argFunction · 0.85

Tested by

no test coverage detected