mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-27 15:35:18 +00:00
Replace BasicFormatter::Format with BasicWriter::FormatInt.
This commit is contained in:
parent
cdfbd128ec
commit
03f68857e2
14
format.cc
14
format.cc
@ -594,22 +594,22 @@ void fmt::BasicFormatter<Char>::DoFormat() {
|
|||||||
// Format argument.
|
// Format argument.
|
||||||
switch (arg.type) {
|
switch (arg.type) {
|
||||||
case INT:
|
case INT:
|
||||||
FormatInt(arg.int_value, spec);
|
writer.FormatInt(arg.int_value, spec);
|
||||||
break;
|
break;
|
||||||
case UINT:
|
case UINT:
|
||||||
FormatInt(arg.uint_value, spec);
|
writer.FormatInt(arg.uint_value, spec);
|
||||||
break;
|
break;
|
||||||
case LONG:
|
case LONG:
|
||||||
FormatInt(arg.long_value, spec);
|
writer.FormatInt(arg.long_value, spec);
|
||||||
break;
|
break;
|
||||||
case ULONG:
|
case ULONG:
|
||||||
FormatInt(arg.ulong_value, spec);
|
writer.FormatInt(arg.ulong_value, spec);
|
||||||
break;
|
break;
|
||||||
case LONG_LONG:
|
case LONG_LONG:
|
||||||
FormatInt(arg.long_long_value, spec);
|
writer.FormatInt(arg.long_long_value, spec);
|
||||||
break;
|
break;
|
||||||
case ULONG_LONG:
|
case ULONG_LONG:
|
||||||
FormatInt(arg.ulong_long_value, spec);
|
writer.FormatInt(arg.ulong_long_value, spec);
|
||||||
break;
|
break;
|
||||||
case DOUBLE:
|
case DOUBLE:
|
||||||
writer.FormatDouble(arg.double_value, spec, precision);
|
writer.FormatDouble(arg.double_value, spec, precision);
|
||||||
@ -658,7 +658,7 @@ void fmt::BasicFormatter<Char>::DoFormat() {
|
|||||||
internal::ReportUnknownType(spec.type_, "pointer");
|
internal::ReportUnknownType(spec.type_, "pointer");
|
||||||
spec.flags_= HASH_FLAG;
|
spec.flags_= HASH_FLAG;
|
||||||
spec.type_ = 'x';
|
spec.type_ = 'x';
|
||||||
FormatInt(reinterpret_cast<uintptr_t>(arg.pointer_value), spec);
|
writer.FormatInt(reinterpret_cast<uintptr_t>(arg.pointer_value), spec);
|
||||||
break;
|
break;
|
||||||
case CUSTOM:
|
case CUSTOM:
|
||||||
if (spec.type_)
|
if (spec.type_)
|
||||||
|
7
format.h
7
format.h
@ -1138,13 +1138,6 @@ class BasicFormatter {
|
|||||||
// writing the output to writer_.
|
// writing the output to writer_.
|
||||||
void DoFormat();
|
void DoFormat();
|
||||||
|
|
||||||
// Formats an integer.
|
|
||||||
// TODO: remove
|
|
||||||
template <typename T>
|
|
||||||
void FormatInt(T value, const FormatSpec &spec) {
|
|
||||||
*writer_ << IntFormatSpec<T, FormatSpec>(value, spec);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Proxy {
|
struct Proxy {
|
||||||
BasicWriter<Char> *writer;
|
BasicWriter<Char> *writer;
|
||||||
const Char *format;
|
const Char *format;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user