2692 char type = spec.type();
2698 case 'e':
case 'f':
case 'g':
case 'a':
2706 case 'E':
case 'G':
case 'A':
2721 sign = spec.flag(
PLUS_FLAG) ?
'+' :
' ';
2727 std::size_t nan_size = 4;
2728 const char *
nan = upper ?
" NAN" :
" nan";
2742 std::size_t inf_size = 4;
2743 const char *
inf = upper ?
" INF" :
" inf";
2755 unsigned width = spec.width();
2764 enum { MAX_FORMAT_SIZE = 10};
2767 *format_ptr++ =
'%';
2768 unsigned width_for_sprintf = width;
2770 *format_ptr++ =
'#';
2772 width_for_sprintf = 0;
2775 *format_ptr++ =
'-';
2777 *format_ptr++ =
'*';
2779 if (spec.precision() >= 0) {
2780 *format_ptr++ =
'.';
2781 *format_ptr++ =
'*';
2785 *format_ptr++ = type;
2789 Char fill = internal::CharTraits<Char>::cast(spec.fill());
2798 if (buffer_size == 0) {
2804 int result = internal::CharTraits<Char>::format_float(
2805 start, buffer_size, format, width_for_sprintf, spec.precision(),
value);
2820 *(start - 1) = sign;
2823 *(start - 1) = fill;
2827 if (spec.align() ==
ALIGN_CENTER && spec.width() > n) {
2828 width = spec.width();
2830 std::memmove(
get(p) + (width - n) / 2,
get(p), n *
sizeof(
Char));
2834 if (spec.fill() !=
' ' ||
sign) {
2835 while (*start ==
' ')
2838 *(start - 1) = sign;
void format(BasicFormatter< Char > &f, const Char *&format_str, const T &value)
Definition: format.h:2963
Definition: format.h:1460
CharPtr grow_buffer(std::size_t n)
Definition: format.h:2234
std::size_t capacity() const
Definition: format.h:608
Definition: format.h:1460
double inf()
Definition: g3dmath.cpp:40
char Char
Definition: bzlib_private.h:41
Definition: format.h:1465
static bool isinfinity(T x)
Definition: format.h:320
internal::CharTraits< Char >::CharPtr CharPtr
Definition: format.h:2218
std::size_t size() const
Definition: format.h:605
MakeUnsigned< Int >::Type to_unsigned(Int value)
Definition: format.h:554
CharPtr write_str(const StrChar *s, std::size_t size, const AlignSpec &spec)
Definition: format.h:2483
void append_float_length(Char *&format_ptr, long double)
Definition: format.h:2301
static bool isnotanumber(T x)
Definition: format.h:333
FMT_API void report_unknown_type(char code, const char *type)
Definition: format.h:1460
Definition: format.h:1465
void reserve(std::size_t capacity)
Definition: format.h:624
const FieldDescriptor value
Definition: descriptor.h:1522
static CharPtr fill_padding(CharPtr buffer, unsigned total_size, std::size_t content_size, wchar_t fill)
Definition: format.h:2528
static bool isnegative(double x)
Definition: format.h:343
Definition: format.h:1460
Buffer< Char > & buffer_
Definition: format.h:2214
double sign(double fValue)
Definition: g3dmath.h:669
double nan()
Definition: g3dmath.cpp:77
Definition: format.h:1465