mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 02:38:13 +00:00
AK: Add Formatter<FormatString> as helper class.
This commit is contained in:
parent
9a842ec419
commit
1160817a9e
13 changed files with 64 additions and 94 deletions
|
@ -66,17 +66,13 @@ inline const LogStream& operator<<(const LogStream& stream, const TextPosition&
|
|||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Formatter<GUI::TextPosition> : Formatter<StringView> {
|
||||
struct AK::Formatter<GUI::TextPosition> : AK::Formatter<FormatString> {
|
||||
void format(FormatBuilder& builder, const GUI::TextPosition& value)
|
||||
{
|
||||
if (value.is_valid())
|
||||
Formatter<StringView>::format(builder, String::formatted("({},{})", value.line(), value.column()));
|
||||
Formatter<FormatString>::format(builder, "({},{})", value.line(), value.column());
|
||||
else
|
||||
Formatter<StringView>::format(builder, "GUI::TextPosition(Invalid)");
|
||||
Formatter<FormatString>::format(builder, "GUI::TextPosition(Invalid)");
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue