summaryrefslogtreecommitdiff
path: root/python/typelibrary.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2023-02-20 21:58:55 -0500
committerGlenn Smith <glenn@vector35.com>2023-11-06 16:10:47 -0500
commit4108964609171327618627477163339656037111 (patch)
tree79f4c6da6394b973cee05cc42b6edd7e2e20909d /python/typelibrary.py
parentb270d7ebe1e2a406e1f7f14807987d24b0c4a846 (diff)
Type Containers
Diffstat (limited to 'python/typelibrary.py')
-rw-r--r--python/typelibrary.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/python/typelibrary.py b/python/typelibrary.py
index 53f3e8ef..364a458d 100644
--- a/python/typelibrary.py
+++ b/python/typelibrary.py
@@ -28,6 +28,7 @@ from . import types
from . import metadata
from . import platform
from . import architecture
+from . import typecontainer
class TypeLibrary:
@@ -227,7 +228,7 @@ class TypeLibrary:
"""
return core.BNFinalizeTypeLibrary(self.handle)
- def query_metadata(self, key: str) -> Optional[metadata.Metadata]:
+ def query_metadata(self, key: str) -> Optional['metadata.MetadataValueType']:
"""
`query_metadata` retrieves a metadata associated with the given key stored in the type library
@@ -281,6 +282,15 @@ class TypeLibrary:
"""
core.BNTypeLibraryRemoveMetadata(self.handle, key)
+ @property
+ def type_container(self) -> 'typecontainer.TypeContainer':
+ """
+ `type_container` returns a TypeContainer interface for interacting with the type library.
+
+ :return: TypeContainer interface
+ """
+ return typecontainer.TypeContainer(core.BNGetTypeLibraryTypeContainer(self.handle))
+
def add_named_object(self, name: 'types.QualifiedName', type: 'types.Type') -> None:
"""
`add_named_object` directly inserts a named object into the type library's object store.