diff options
| author | Glenn Smith <glenn@vector35.com> | 2021-06-25 18:08:55 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2021-07-01 01:32:28 -0400 |
| commit | 8f0f90294096ed12e099b0572e28b531636e4fd8 (patch) | |
| tree | f0d15a077c4829e7a5ec290c2532f1126eaa71f5 /binaryview.cpp | |
| parent | 78f177679cfacfcfb4f9ff542cb20a04914aed1f (diff) | |
GetAllTagReferenceTypeCounts for optimized all-counts list
Diffstat (limited to 'binaryview.cpp')
| -rw-r--r-- | binaryview.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
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> tagType) } +std::map<Ref<TagType>, size_t> BinaryView::GetAllTagReferenceTypeCounts() +{ + BNTagType** types; + size_t* counts; + size_t count; + BNGetAllTagReferenceTypeCounts(m_object, &types, &counts, &count); + + std::map<Ref<TagType>, 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> tagType) { return BNGetTagReferencesOfTypeCount(m_object, tagType->GetObject()); |
