mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
AK: Add a AK::Formatter implementation for AK::SourceLocation
This commit is contained in:
parent
b42bfa75d8
commit
357a13b404
Notes:
sideshowbarker
2024-07-18 19:08:36 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/357a13b404c Pull-request: https://github.com/SerenityOS/serenity/pull/6623
1 changed files with 9 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/Format.h>
|
||||||
#include <AK/StringView.h>
|
#include <AK/StringView.h>
|
||||||
#include <AK/Types.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;
|
using AK::SourceLocation;
|
||||||
|
|
Loading…
Reference in a new issue