diff --git a/upb/reflection/def.hpp b/upb/reflection/def.hpp index cf28a38ff9..452ddc6e32 100644 --- a/upb/reflection/def.hpp +++ b/upb/reflection/def.hpp @@ -61,6 +61,13 @@ class FieldDefPtr { return upb_FieldDef_MiniTable(ptr_); } + std::string MiniDescriptorEncode() const { + upb::Arena arena; + upb_StringView md; + upb_FieldDef_MiniDescriptorEncode(ptr_, arena.ptr(), &md); + return std::string(md.data, md.size); + } + const UPB_DESC(FieldOptions) * options() const { return upb_FieldDef_Options(ptr_); }