1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

AK: Add formatter for boolean values.

This commit is contained in:
asynts 2020-09-30 13:26:24 +02:00 committed by Andreas Kling
parent 7e9cd8a860
commit ebafc5b4d2
3 changed files with 39 additions and 0 deletions

View file

@ -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)
{