summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2025-05-21 16:40:29 -0400
committerGlenn Smith <glenn@vector35.com>2025-05-22 15:09:43 -0400
commit9773903467337041452869116900155132108757 (patch)
treefb05bf92981c83b1a4a5e5e9721637d43b2deb7d /binaryninjaapi.h
parent6458016449500151053964411398145244374352 (diff)
Fix Ref<T> and Confidence<T> formatters
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 42364c2c..ff23cbd2 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -20973,20 +20973,25 @@ namespace std
template<typename T> struct fmt::formatter<BinaryNinja::Ref<T>>
{
+ fmt::formatter<T> inner;
format_context::iterator format(const BinaryNinja::Ref<T>& obj, format_context& ctx) const
{
- return fmt::formatter<T>().format(*obj.GetPtr(), ctx);
+ return inner.format(*obj.GetPtr(), ctx);
}
- constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator { return ctx.begin(); }
+ constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator { return inner.parse(ctx); }
};
template<typename T> struct fmt::formatter<BinaryNinja::Confidence<T>>
{
+ fmt::formatter<T> inner;
format_context::iterator format(const BinaryNinja::Confidence<T>& obj, format_context& ctx) const
{
- return fmt::format_to(ctx.out(), "{} ({} confidence)", obj.GetValue(), obj.GetConfidence());
+ auto out = ctx.out();
+ out = inner.format(obj.GetValue(), ctx);
+ ctx.advance_to(out);
+ return fmt::format_to(out, " ({} confidence)", obj.GetConfidence());
}
- constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator { return ctx.begin(); }
+ constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator { return inner.parse(ctx); }
};
template<> struct fmt::formatter<BinaryNinja::Metadata>