diff options
| author | Glenn Smith <glenn@vector35.com> | 2022-11-15 16:21:43 -0500 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2022-11-16 13:57:49 -0500 |
| commit | 2b7ff4a4a4033e9f434da6f6b186d4798dbe59ee (patch) | |
| tree | 143f9f7850438b7a43df378e971e7ab7fc53558d /binaryview.cpp | |
| parent | ebfbe25ef9b0ae5f5d6c6d53bd5faee7b9a77d59 (diff) | |
Add BinaryView::GetDependencySortedTypes
Diffstat (limited to 'binaryview.cpp')
| -rw-r--r-- | binaryview.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp index e8c108a0..9459fdd0 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -3426,6 +3426,23 @@ map<QualifiedName, Ref<Type>> BinaryView::GetTypes() } +vector<pair<QualifiedName, Ref<Type>>> BinaryView::GetDependencySortedTypes() +{ + size_t count; + BNQualifiedNameAndType* types = BNGetAnalysisDependencySortedTypeList(m_object, &count); + + vector<pair<QualifiedName, Ref<Type>>> result; + for (size_t i = 0; i < count; i++) + { + QualifiedName name = QualifiedName::FromAPIObject(&types[i].name); + result.emplace_back(name, new Type(BNNewTypeReference(types[i].type))); + } + + BNFreeTypeList(types, count); + return result; +} + + vector<QualifiedName> BinaryView::GetTypeNames(const string& matching) { size_t count; |
