summaryrefslogtreecommitdiff
path: root/type.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-08-11 08:31:03 -0400
committerPeter LaFosse <peter@vector35.com>2021-09-05 10:09:10 -0400
commit55cf411c056ceb725d8172cc71318d32f5a3b207 (patch)
treecd20baa655fdabe0207499835bcfe5a4f9ff227d /type.cpp
parentc7b9b0330bc3b7121d8664a3eeec174739e5cc5e (diff)
Move MemberAccess/MemberScope to StructureMember
Fix rust AddStructureMemebers
Diffstat (limited to 'type.cpp')
-rw-r--r--type.cpp61
1 files changed, 10 insertions, 51 deletions
diff --git a/type.cpp b/type.cpp
index 1ae7f711..3d7339e4 100644
--- a/type.cpp
+++ b/type.cpp
@@ -496,20 +496,6 @@ Confidence<bool> Type::IsConst() const
}
-Confidence<BNMemberScope> Type::GetScope() const
-{
- BNMemberScopeWithConfidence result = BNTypeGetMemberScope(m_object);
- return Confidence<BNMemberScope>(result.value, result.confidence);
-}
-
-
-Confidence<BNMemberAccess> Type::GetAccess() const
-{
- BNMemberAccessWithConfidence result = BNTypeGetMemberAccess(m_object);
- return Confidence<BNMemberAccess>(result.value, result.confidence);
-}
-
-
Confidence<Ref<Type>> Type::GetChildType() const
{
BNTypeWithConfidence type = BNGetChildType(m_object);
@@ -1133,39 +1119,6 @@ void TypeBuilder::SetIntegerTypeDisplayType(BNIntegerDisplayType displayType)
BNSetIntegerTypeDisplayType(m_object, displayType);
}
-Confidence<BNMemberScope> TypeBuilder::GetScope() const
-{
- BNMemberScopeWithConfidence result = BNTypeBuilderGetMemberScope(m_object);
- return Confidence<BNMemberScope>(result.value, result.confidence);
-}
-
-
-TypeBuilder& TypeBuilder::SetScope(const Confidence<BNMemberScope>& scope)
-{
- BNMemberScopeWithConfidence mc;
- mc.value = scope.GetValue();
- mc.confidence = scope.GetConfidence();
- BNTypeBuilderSetMemberScope(m_object, &mc);
- return *this;
-}
-
-
-Confidence<BNMemberAccess> TypeBuilder::GetAccess() const
-{
- BNMemberAccessWithConfidence result = BNTypeBuilderGetMemberAccess(m_object);
- return Confidence<BNMemberAccess>(result.value, result.confidence);
-}
-
-
-TypeBuilder& TypeBuilder::SetAccess(const Confidence<BNMemberAccess>& access)
-{
- BNMemberAccessWithConfidence mc;
- mc.value = access.GetValue();
- mc.confidence = access.GetConfidence();
- BNTypeBuilderSetMemberAccess(m_object, &mc);
- return *this;
-}
-
TypeBuilder& TypeBuilder::SetConst(const Confidence<bool>& cnst)
{
@@ -1447,6 +1400,11 @@ TypeBuilder TypeBuilder::EnumerationType(Architecture* arch, EnumerationBuilder*
}
+TypeBuilder TypeBuilder::EnumerationType(Enumeration* enm, size_t width, bool isSigned)
+{
+ return TypeBuilder(BNCreateEnumerationTypeBuilderOfWidth(enm->GetObject(), width, isSigned));
+}
+
TypeBuilder TypeBuilder::PointerType(Architecture* arch, const Confidence<Ref<Type>>& type,
const Confidence<bool>& cnst, const Confidence<bool>& vltl, BNReferenceType refType)
{
@@ -2035,23 +1993,24 @@ BNStructureVariant StructureBuilder::GetStructureType() const
}
-StructureBuilder& StructureBuilder::AddMember(const Confidence<Ref<Type>>& type, const string& name)
+StructureBuilder& StructureBuilder::AddMember(const Confidence<Ref<Type>>& type, const string& name,
+ BNMemberAccess access, BNMemberScope scope)
{
BNTypeWithConfidence tc;
tc.type = type->GetObject();
tc.confidence = type.GetConfidence();
- BNAddStructureBuilderMember(m_object, &tc, name.c_str());
+ BNAddStructureBuilderMember(m_object, &tc, name.c_str(), access, scope);
return *this;
}
StructureBuilder& StructureBuilder::AddMemberAtOffset(const Confidence<Ref<Type>>& type,
- const string& name, uint64_t offset, bool overwriteExisting)
+ const string& name, uint64_t offset, bool overwriteExisting, BNMemberAccess access, BNMemberScope scope)
{
BNTypeWithConfidence tc;
tc.type = type->GetObject();
tc.confidence = type.GetConfidence();
- BNAddStructureBuilderMemberAtOffset(m_object, &tc, name.c_str(), offset, overwriteExisting);
+ BNAddStructureBuilderMemberAtOffset(m_object, &tc, name.c_str(), offset, overwriteExisting, access, scope);
return *this;
}