summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2019-04-05 21:55:47 -0400
committerPeter LaFosse <peter@vector35.com>2019-04-07 18:19:49 -0400
commite34e52c2f797c9b97b592abb311e3a5bc2194b4a (patch)
tree713307be0740705debbd5a3ca62abc6234b510d8 /binaryview.cpp
parent5de327770ec8c3f1aca9c774d850442edb9a3610 (diff)
Add API for geting a list of type names without the associated objects
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index 3bf61f34..1c345dfb 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -1928,6 +1928,23 @@ map<QualifiedName, Ref<Type>> BinaryView::GetTypes()
}
+vector<QualifiedName> BinaryView::GetTypeNames(const string& matching)
+{
+ size_t count;
+ BNQualifiedName* names = BNGetAnalysisTypeNames(m_object, &count, matching.c_str());
+
+ vector<QualifiedName> result;
+ result.reserve(count);
+ for (size_t i = 0; i < count; i++)
+ {
+ result.push_back(QualifiedName::FromAPIObject(&names[i]));
+ }
+
+ BNFreeTypeNameList(names, count);
+ return result;
+}
+
+
Ref<Type> BinaryView::GetTypeByName(const QualifiedName& name)
{
BNQualifiedName nameObj = name.GetAPIObject();