summaryrefslogtreecommitdiff
path: root/type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'type.cpp')
-rw-r--r--type.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/type.cpp b/type.cpp
index 34e142b6..e0235664 100644
--- a/type.cpp
+++ b/type.cpp
@@ -235,6 +235,12 @@ Ref<Type> Type::StructureType(Structure* strct)
}
+Ref<Type> Type::UnknownNamedType(UnknownType* unknwn)
+{
+ return new Type(BNCreateUnknownNamedType(unknwn->GetObject()));
+}
+
+
Ref<Type> Type::EnumerationType(Architecture* arch, Enumeration* enm, size_t width, bool isSigned)
{
return new Type(BNCreateEnumerationType(arch->GetObject(), enm->GetObject(), width, isSigned));
@@ -277,6 +283,46 @@ void Type::SetFunctionCanReturn(bool canReturn)
}
+UnknownType::UnknownType(BNUnknownType* ut, vector<string> names)
+{
+ m_object = ut;
+ const char ** nameList = new const char*[names.size()];
+ for (size_t i = 0; i < names.size(); i++)
+ {
+ nameList[i] = names[i].c_str();
+ }
+ BNSetUnknownTypeName(ut, nameList, names.size());
+ delete [] nameList;
+}
+
+
+void UnknownType::SetName(const vector<string>& names)
+{
+ const char ** nameList = new const char*[names.size()];
+ for (size_t i = 0; i < names.size(); i++)
+ {
+ nameList[i] = names[i].c_str();
+ }
+ BNSetUnknownTypeName(m_object, nameList, names.size());
+ delete [] nameList;
+}
+
+
+vector<string> UnknownType::GetName() const
+{
+ size_t size;
+ char** name = BNGetUnknownTypeName(m_object, &size);
+ vector<string> result;
+ for (size_t i = 0; i < size; i++)
+ {
+ result.push_back(name[i]);
+ BNFreeString(name[i]);
+ }
+ delete [] name;
+ return result;
+}
+
+
Structure::Structure(BNStructure* s)
{
m_object = s;