summaryrefslogtreecommitdiff
path: root/python/typecontainer.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2025-10-15 13:07:19 -0400
committerPeter LaFosse <peter@vector35.com>2025-10-16 13:37:08 -0400
commitcd9eea2fdbd51c25a9f17435c561b6fe9377960f (patch)
tree98bb9755c8ce1d74f8d3c6934d0735a61377e7ae /python/typecontainer.py
parent4780a8414c41099f49c5cb9a780bfffd084bdd47 (diff)
Add GetTypeCount API
Add note about type_names not being sorted anymore
Diffstat (limited to 'python/typecontainer.py')
-rw-r--r--python/typecontainer.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/typecontainer.py b/python/typecontainer.py
index b4a9e794..aafa9117 100644
--- a/python/typecontainer.py
+++ b/python/typecontainer.py
@@ -329,6 +329,14 @@ class TypeContainer:
core.BNFreeStringList(result_ids, result_count.value)
return result
+ @property
+ def type_count(self) -> int:
+ """
+ Get the number of types in a Type Container.
+ :return: Number of types in the container
+ """
+ return core.BNTypeContainerGetTypeCount(self.handle)
+
def parse_type_string(
self, source: str, import_dependencies: bool = True
) -> Tuple[Optional[Tuple['_types.QualifiedNameType', '_types.Type']], List['typeparser.TypeParserError']]: