mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:37:34 +00:00
AK: Add a AK::Formatter implementation for AK::SourceLocation
This commit is contained in:
parent
b42bfa75d8
commit
357a13b404
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue