summaryrefslogtreecommitdiff
path: root/platform.cpp
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-11-17 17:19:34 -0500
committerGlenn Smith <glenn@vector35.com>2022-11-30 18:35:17 -0500
commit4c242707996e94877d3e2762a2ef88835e98abbc (patch)
tree14e364a8c79e28a4f7584c8c776495ee20f762d0 /platform.cpp
parent9372cd0e81000ca4d5e412e8eecde16424d346bd (diff)
Type library C++ api & import recording
Diffstat (limited to 'platform.cpp')
-rw-r--r--platform.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/platform.cpp b/platform.cpp
index b3ec68e8..06d65539 100644
--- a/platform.cpp
+++ b/platform.cpp
@@ -342,6 +342,38 @@ map<uint32_t, QualifiedNameAndType> Platform::GetSystemCalls()
}
+vector<Ref<TypeLibrary>> Platform::GetTypeLibraries()
+{
+ size_t count;
+ BNTypeLibrary** libs = BNGetPlatformTypeLibraries(m_object, &count);
+
+ vector<Ref<TypeLibrary>> result;
+ for (size_t i = 0; i < count; ++i)
+ {
+ result.push_back(new TypeLibrary(BNNewTypeLibraryReference(libs[i])));
+ }
+
+ BNFreeTypeLibraryList(libs, count);
+ return result;
+}
+
+
+vector<Ref<TypeLibrary>> Platform::GetTypeLibrariesByName(const std::string& name)
+{
+ size_t count;
+ BNTypeLibrary** libs = BNGetPlatformTypeLibrariesByName(m_object, name.c_str(), &count);
+
+ vector<Ref<TypeLibrary>> result;
+ for (size_t i = 0; i < count; ++i)
+ {
+ result.push_back(new TypeLibrary(BNNewTypeLibraryReference(libs[i])));
+ }
+
+ BNFreeTypeLibraryList(libs, count);
+ return result;
+}
+
+
Ref<Type> Platform::GetTypeByName(const QualifiedName& name)
{
BNQualifiedName nameObj = name.GetAPIObject();