mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:57:45 +00:00
AK: Add special formatter for char.
When we format a character we want to put the ascii value and not the decimal value. The old behaviour can be obtained with '{:d}'.
This commit is contained in:
parent
6eb6752c4c
commit
aa283d235a
1 changed files with 8 additions and 0 deletions
|
@ -280,6 +280,14 @@ struct Formatter<T*> : StandardFormatter {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct Formatter<char> : Formatter<StringView> {
|
||||||
|
void format(TypeErasedFormatParams& params, FormatBuilder& builder, char value)
|
||||||
|
{
|
||||||
|
Formatter<StringView>::format(params, builder, { &value, 1 });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct Formatter<bool> : StandardFormatter {
|
struct Formatter<bool> : StandardFormatter {
|
||||||
void format(TypeErasedFormatParams&, FormatBuilder&, bool value);
|
void format(TypeErasedFormatParams&, FormatBuilder&, bool value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue