1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 01:50:46 +00:00

AK: Add a AK::Formatter implementation for AK::SourceLocation

This commit is contained in:
Brian Gianforcaro 2021-04-24 20:01:26 -07:00 committed by Andreas Kling
parent b42bfa75d8
commit 357a13b404

View File

@ -7,6 +7,7 @@
#pragma once
#include <AK/Format.h>
#include <AK/StringView.h>
#include <AK/Types.h>
@ -38,4 +39,12 @@ private:
}
template<>
struct AK::Formatter<AK::SourceLocation> : AK::Formatter<FormatString> {
void format(FormatBuilder& builder, AK::SourceLocation location)
{
return AK::Formatter<FormatString>::format(builder, "[{} @ {}:{}]", location.function_name(), location.file_name(), location.line_number());
}
};
using AK::SourceLocation;