summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-11-15 16:21:43 -0500
committerGlenn Smith <glenn@vector35.com>2022-11-16 13:57:49 -0500
commit2b7ff4a4a4033e9f434da6f6b186d4798dbe59ee (patch)
tree143f9f7850438b7a43df378e971e7ab7fc53558d /binaryninjaapi.h
parentebfbe25ef9b0ae5f5d6c6d53bd5faee7b9a77d59 (diff)
Add BinaryView::GetDependencySortedTypes
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index b738c92a..8cb0a7b2 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -4423,6 +4423,17 @@ namespace BinaryNinja {
std::string& errors, const std::set<QualifiedName>& typesAllowRedefinition = {});
std::map<QualifiedName, Ref<Type>> GetTypes();
+ /*! List of all types, sorted such that types are after all types on which they depend
+
+ Order is guaranteed for any collection of types with no cycles. If you have cycles
+ in type dependencies, order for types in a cycle is not guaranteed.
+
+ \note Dependency order is based on named type references for all non-structure types, i.e.
+ ``struct Foo m_foo`` will induce a dependency, whereas ``struct Foo* m_pFoo`` will not.
+
+ \return Sorted types as defined above
+ */
+ std::vector<std::pair<QualifiedName, Ref<Type>>> GetDependencySortedTypes();
std::vector<QualifiedName> GetTypeNames(const std::string& matching = "");
Ref<Type> GetTypeByName(const QualifiedName& name);
Ref<Type> GetTypeByRef(Ref<NamedTypeReference> name);