mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-14 13:32:23 +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
Notes:
sideshowbarker
2024-07-19 02:04:46 +09:00
Author: https://github.com/asynts
Commit: aa283d235a
Pull-request: https://github.com/SerenityOS/serenity/pull/3679
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