diff options
Diffstat (limited to 'component.cpp')
| -rw-r--r-- | component.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/component.cpp b/component.cpp index 88e7a20a..03be498a 100644 --- a/component.cpp +++ b/component.cpp @@ -71,6 +71,12 @@ bool Component::AddComponent(Ref<Component> component) } +bool Component::AddDataVariable(DataVariable dataVariable) +{ + return BNComponentAddDataVariable(m_object, dataVariable.address); +} + + bool Component::RemoveComponent(Ref<Component> component) { return BNComponentRemoveComponent(component->m_object); @@ -83,6 +89,12 @@ bool Component::RemoveFunction(Ref<Function> func) } +bool Component::RemoveDataVariable(DataVariable dataVariable) +{ + return BNComponentRemoveDataVariable(m_object, dataVariable.address); +} + + std::vector<Ref<Component>> Component::GetContainedComponents() { std::vector<Ref<Component>> components; @@ -123,6 +135,27 @@ std::vector<Ref<Function>> Component::GetContainedFunctions() } +std::vector<DataVariable> Component::GetContainedDataVariables() +{ + vector<DataVariable> result; + + size_t count; + BNDataVariable* variables = BNComponentGetContainedDataVariables(m_object, &count); + + result.reserve(count); + for (size_t i = 0; i < count; ++i) + { + result.emplace_back(variables[i].address, + Confidence(new Type(BNNewTypeReference(variables[i].type)), variables[i].typeConfidence), + variables[i].autoDiscovered); + } + + BNFreeDataVariables(variables, count); + return result; +} + + + std::vector<Ref<Type>> Component::GetReferencedTypes() { std::vector<Ref<Type>> types; |
