mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +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
|
@ -268,12 +268,3 @@ const LogStream& operator<<(const LogStream& stream, const Object& object)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
|
||||
void Formatter<Core::Object>::format(FormatBuilder& builder, const Core::Object& value)
|
||||
{
|
||||
Formatter<StringView>::format(builder, String::formatted("{}({})", value.class_name(), &value));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -173,12 +173,13 @@ private:
|
|||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
template<>
|
||||
struct Formatter<Core::Object> : Formatter<StringView> {
|
||||
void format(FormatBuilder&, const Core::Object&);
|
||||
struct AK::Formatter<Core::Object> : AK::Formatter<FormatString> {
|
||||
void format(FormatBuilder& builder, const Core::Object& value)
|
||||
{
|
||||
return AK::Formatter<FormatString>::format(builder, "{}({})", value.class_name(), &value);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
namespace Core {
|
||||
template<typename T, typename Callback>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue