3521 using internal::Arg;
3522 const Char *s = format_str;
3525 if (
arg.type == Arg::CUSTOM) {
3526 arg.custom.format(
this,
arg.custom.value, &s);
3532 const Char *p = s + 1;
3551 if (c ==
'}')
break;
3553 FMT_THROW(FormatError(
"invalid fill character '{'"));
3595 if (
'0' <= *s && *s <=
'9') {
3597 }
else if (*s ==
'{') {
3602 FMT_THROW(FormatError(
"invalid format string"));
3604 switch (width_arg.
type) {
3607 FMT_THROW(FormatError(
"negative width"));
3613 case Arg::LONG_LONG:
3615 FMT_THROW(FormatError(
"negative width"));
3618 case Arg::ULONG_LONG:
3622 FMT_THROW(FormatError(
"width is not integer"));
3625 FMT_THROW(FormatError(
"number is too big"));
3626 spec.width_ =
static_cast<int>(
value);
3632 spec.precision_ = 0;
3633 if (
'0' <= *s && *s <=
'9') {
3635 }
else if (*s ==
'{') {
3640 FMT_THROW(FormatError(
"invalid format string"));
3642 switch (precision_arg.
type) {
3645 FMT_THROW(FormatError(
"negative precision"));
3651 case Arg::LONG_LONG:
3653 FMT_THROW(FormatError(
"negative precision"));
3656 case Arg::ULONG_LONG:
3660 FMT_THROW(FormatError(
"precision is not integer"));
3663 FMT_THROW(FormatError(
"number is too big"));
3664 spec.precision_ =
static_cast<int>(
value);
3666 FMT_THROW(FormatError(
"missing precision specifier"));
3668 if (
arg.type <= Arg::LAST_INTEGER_TYPE ||
arg.type == Arg::POINTER) {
3670 fmt::format(
"precision not allowed in {} format specifier",
3671 arg.type == Arg::POINTER ?
"pointer" :
"integer")));
3676 if (*s !=
'}' && *s)
3677 spec.type_ =
static_cast<char>(*s++);
3681 FMT_THROW(FormatError(
"missing '}' in format string"));
3684 internal::BasicArgFormatter<Char>(*
this, spec, s - 1).visit(
arg);
void format(BasicFormatter< Char > &f, const Char *&format_str, const T &value)
Definition: format.h:2963
Definition: format.h:1460
FMT_GCC_EXTENSION typedef unsigned long long ULongLong
Definition: format.h:362
Definition: format.h:1460
unsigned parse_nonnegative_int(const Char *&s)
Definition: format.h:3439
T max(const T &x, const T &y)
Definition: g3dmath.h:320
Definition: format.h:1460
char Char
Definition: bzlib_private.h:41
unsigned uint_value
Definition: format.h:958
Definition: format.h:1465
Definition: format.h:1465
int int_value
Definition: format.h:957
void check_sign(const Char *&s, const Arg &arg)
Definition: format.h:3467
Definition: format.h:1460
internal::NamedArg< char > arg(StringRef name, const T &arg)
Definition: format.h:3248
void require_numeric_argument(const Arg &arg, char spec)
Definition: format.h:3458
Definition: format.h:1465
ULongLong ulong_long_value
Definition: format.h:960
const FieldDescriptor value
Definition: descriptor.h:1522
Type type
Definition: format.h:984
LongLong long_long_value
Definition: format.h:959
Definition: format.h:1460
Definition: format.h:1465
bool is_name_start(Char c)
Definition: format.h:3432