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

AK: Add Formatter<FormatString> as helper class.

This commit is contained in:
asynts 2021-01-09 01:00:22 +01:00 committed by Andreas Kling
parent 9a842ec419
commit 1160817a9e
13 changed files with 64 additions and 94 deletions

View file

@ -521,6 +521,11 @@ void Formatter<StringView>::format(FormatBuilder& builder, StringView value)
builder.put_string(value, m_align, m_width.value(), m_precision.value(), m_fill);
}
void Formatter<FormatString>::vformat(FormatBuilder& builder, StringView fmtstr, TypeErasedFormatParams params)
{
return Formatter<String>::format(builder, String::vformatted(fmtstr, params));
}
template<typename T>
void Formatter<T, typename EnableIf<IsIntegral<T>::value>::Type>::format(FormatBuilder& builder, T value)
{