mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:27:35 +00:00
AK: Add formatter for boolean values.
This commit is contained in:
parent
7e9cd8a860
commit
ebafc5b4d2
3 changed files with 39 additions and 0 deletions
17
AK/Format.h
17
AK/Format.h
|
@ -166,6 +166,12 @@ struct StandardFormatter {
|
|||
|
||||
template<>
|
||||
struct Formatter<StringView> : StandardFormatter {
|
||||
Formatter() { }
|
||||
explicit Formatter(StandardFormatter formatter)
|
||||
: StandardFormatter(formatter)
|
||||
{
|
||||
}
|
||||
|
||||
void format(StringBuilder& builder, StringView value, FormatterContext&);
|
||||
};
|
||||
template<>
|
||||
|
@ -183,9 +189,20 @@ struct Formatter<String> : Formatter<StringView> {
|
|||
|
||||
template<typename T>
|
||||
struct Formatter<T, typename EnableIf<IsIntegral<T>::value>::Type> : StandardFormatter {
|
||||
Formatter() { }
|
||||
explicit Formatter(StandardFormatter formatter)
|
||||
: StandardFormatter(formatter)
|
||||
{
|
||||
}
|
||||
|
||||
void format(StringBuilder&, T value, FormatterContext&);
|
||||
};
|
||||
|
||||
template<>
|
||||
struct Formatter<bool> : StandardFormatter {
|
||||
void format(StringBuilder&, bool value, FormatterContext&);
|
||||
};
|
||||
|
||||
template<typename... Parameters>
|
||||
Array<TypeErasedParameter, sizeof...(Parameters)> make_type_erased_parameters(const Parameters&... parameters)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue