mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:07:45 +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
|
@ -82,8 +82,14 @@ const LogStream& operator<<(const LogStream&, const ModelIndex&);
|
|||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Formatter<GUI::ModelIndex> : Formatter<StringView> {
|
||||
void format(FormatBuilder&, const GUI::ModelIndex&);
|
||||
struct Formatter<GUI::ModelIndex> : Formatter<FormatString> {
|
||||
void format(FormatBuilder& builder, const GUI::ModelIndex& value)
|
||||
{
|
||||
if (value.internal_data())
|
||||
return Formatter<FormatString>::format(builder, "ModelIndex({},{},{})", value.row(), value.column(), value.internal_data());
|
||||
else
|
||||
return Formatter<FormatString>::format(builder, "ModelIndex({},{})", value.row(), value.column());
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue