summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/binaryview.py5
-rw-r--r--python/typecontainer.py8
2 files changed, 12 insertions, 1 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 26d20edd..4a8526e3 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -3471,7 +3471,10 @@ class BinaryView:
@property
def type_names(self) -> List['_types.QualifiedName']:
- """List of defined type names (read-only)"""
+ """List of defined type names (read-only)
+
+ .. note:: Sort order is not guaranteed in 5.2 and later.
+ """
count = ctypes.c_ulonglong(0)
name_list = core.BNGetAnalysisTypeNames(self.handle, count, "")
assert name_list is not None, "core.BNGetAnalysisTypeNames returned None"
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']]: