diff options
| author | Rusty Wagner <rusty@vector35.com> | 2017-02-09 19:06:07 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2017-02-09 19:06:07 -0500 |
| commit | 898ec98d9858ddec7fb431ba304d996cec12ff68 (patch) | |
| tree | e45860783bc3412de8e52d4d1267da670d744fc6 /platform.cpp | |
| parent | 8df9a34dd67c852626432c84a5007be3173c33e0 (diff) | |
APIs for handling platform types
Diffstat (limited to 'platform.cpp')
| -rw-r--r-- | platform.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/platform.cpp b/platform.cpp index 7a6571cc..3bf4c0a4 100644 --- a/platform.cpp +++ b/platform.cpp @@ -253,3 +253,31 @@ Ref<Platform> Platform::GetAssociatedPlatformByAddress(uint64_t& addr) return nullptr; return new Platform(platform); } + + +string Platform::GenerateAutoPlatformTypeId(const QualifiedName& name) +{ + BNQualifiedName nameObj = name.GetAPIObject(); + char* str = BNGenerateAutoPlatformTypeId(m_object, &nameObj); + string result = str; + QualifiedName::FreeAPIObject(&nameObj); + BNFreeString(str); + return result; +} + + +Ref<NamedTypeReference> Platform::GenerateAutoPlatformTypeReference(BNNamedTypeReferenceClass cls, + const QualifiedName& name) +{ + string id = GenerateAutoPlatformTypeId(name); + return new NamedTypeReference(cls, id, name); +} + + +string Platform::GetAutoPlatformTypeIdSource() +{ + char* str = BNGetAutoPlatformTypeIdSource(m_object); + string result = str; + BNFreeString(str); + return result; +} |
