summaryrefslogtreecommitdiff
path: root/python/typelibrary.py
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2026-02-13 19:19:19 -0800
committerMason Reed <35282038+emesare@users.noreply.github.com>2026-02-23 00:09:44 -0800
commit9c2a45b7b78742b0cfe0a8599b8fdbf1d24533d3 (patch)
treec3977a858be50c30c7f06426efe2120fd56fbe45 /python/typelibrary.py
parent8e9fd28ab887ce63a04db50f9b82a35a81996748 (diff)
[Python] Add `TypeLibrary.remove_named_object` and `TypeLibrary.remove_named_type`
Diffstat (limited to 'python/typelibrary.py')
-rw-r--r--python/typelibrary.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/python/typelibrary.py b/python/typelibrary.py
index 14b882ea..71848c23 100644
--- a/python/typelibrary.py
+++ b/python/typelibrary.py
@@ -374,6 +374,16 @@ class TypeLibrary:
raise ValueError("type must be a Type")
core.BNAddTypeLibraryNamedObject(self.handle, name._to_core_struct(), type.handle)
+ def remove_named_object(self, name: 'types.QualifiedName') -> None:
+ """
+ `remove_named_object` removes a named object from the type library's object store.
+ This does not remove any types that are referenced by the object, only the object itself.
+
+ :param QualifiedName name:
+ :rtype: None
+ """
+ core.BNRemoveTypeLibraryNamedObject(self.handle, name._to_core_struct())
+
def add_named_type(self, name: 'types.QualifiedNameType', type: 'types.Type') -> None:
"""
`add_named_type` directly inserts a named object into the type library's object store.
@@ -395,6 +405,13 @@ class TypeLibrary:
raise ValueError("parameter type must be a Type")
core.BNAddTypeLibraryNamedType(self.handle, name._to_core_struct(), type.handle)
+ def remove_named_type(self, name: 'types.QualifiedName') -> None:
+ """
+ `remove_named_type` removes a named type from the type library's type store.
+ This does not remove any objects that reference the type, only the type itself.
+ """
+ core.BNRemoveTypeLibraryNamedType(self.handle, name._to_core_struct())
+
def add_type_source(self, name: types.QualifiedName, source: str) -> None:
"""
Manually flag NamedTypeReferences to the given QualifiedName as originating from another source