From 8f0f90294096ed12e099b0572e28b531636e4fd8 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Fri, 25 Jun 2021 18:08:55 -0400 Subject: GetAllTagReferenceTypeCounts for optimized all-counts list --- binaryview.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'binaryview.cpp') diff --git a/binaryview.cpp b/binaryview.cpp index 657a5cd7..b4ed691d 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -2496,6 +2496,24 @@ size_t BinaryView::GetAllTagReferencesOfTypeCount(Ref tagType) } +std::map, size_t> BinaryView::GetAllTagReferenceTypeCounts() +{ + BNTagType** types; + size_t* counts; + size_t count; + BNGetAllTagReferenceTypeCounts(m_object, &types, &counts, &count); + + std::map, size_t> result; + for (size_t i = 0; i < count; i ++) + { + result[new TagType(BNNewTagTypeReference(types[i]))] = counts[i]; + } + + BNFreeTagReferenceTypeCounts(types, counts); + return result; +} + + size_t BinaryView::GetTagReferencesOfTypeCount(Ref tagType) { return BNGetTagReferencesOfTypeCount(m_object, tagType->GetObject()); -- cgit v1.3.1