Skip to content

Commit 9773903

Browse files
committed
Fix Ref<T> and Confidence<T> formatters
1 parent 6458016 commit 9773903

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

binaryninjaapi.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20973,20 +20973,25 @@ namespace std
2097320973

2097420974
template<typename T> struct fmt::formatter<BinaryNinja::Ref<T>>
2097520975
{
20976+
fmt::formatter<T> inner;
2097620977
format_context::iterator format(const BinaryNinja::Ref<T>& obj, format_context& ctx) const
2097720978
{
20978-
return fmt::formatter<T>().format(*obj.GetPtr(), ctx);
20979+
return inner.format(*obj.GetPtr(), ctx);
2097920980
}
20980-
constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator { return ctx.begin(); }
20981+
constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator { return inner.parse(ctx); }
2098120982
};
2098220983

2098320984
template<typename T> struct fmt::formatter<BinaryNinja::Confidence<T>>
2098420985
{
20986+
fmt::formatter<T> inner;
2098520987
format_context::iterator format(const BinaryNinja::Confidence<T>& obj, format_context& ctx) const
2098620988
{
20987-
return fmt::format_to(ctx.out(), "{} ({} confidence)", obj.GetValue(), obj.GetConfidence());
20989+
auto out = ctx.out();
20990+
out = inner.format(obj.GetValue(), ctx);
20991+
ctx.advance_to(out);
20992+
return fmt::format_to(out, " ({} confidence)", obj.GetConfidence());
2098820993
}
20989-
constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator { return ctx.begin(); }
20994+
constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator { return inner.parse(ctx); }
2099020995
};
2099120996

2099220997
template<> struct fmt::formatter<BinaryNinja::Metadata>

0 commit comments

Comments
 (0)