Class |
Description |
|---|---|
Components are objects that can contain Functions and other Components. |
Bases: object
Components are objects that can contain Functions and other Components.
They can be queried for information about the functions contained within them.
Components have a Guid, which persistent across saves and loads of the database, and should be used for retrieving components when such is required and a reference to the Component cannot be held.
Move component to this component. This will remove it from the old parent.
Check whether this component contains a component.
Get data variables referenced by this component
recursive – Optional; Get all DataVariables referenced by this component and sub-components.
List of DataVariables
Get Types referenced by this component
recursive – Optional; Get all Types referenced by this component and sub-components.
List of Types
Remove a component from the current component, moving it to the root.
This function has no effect when used from the root component. Use BinaryView.remove_component to Remove a component from the tree entirely.
components is an iterator for all Components contained within this Component
A list of components
>>> for subcomp in component.components:
... print(repr(component))
function_list List of all Functions contained within this Component
.functions Should be used instead of this in any performance sensitive context.
A list of functions
>>> for func in component.functions:
... print(func.name)
functions is an iterator for all Functions contained within this Component
An iterator containing Components
ComponentIterator
>>> for func in component.functions:
... print(func.name)
Original name set for this component
The .display_name property should be used for bv.get_component_by_path() lookups.
This can differ from the .display_name property if one of its sibling components has the same .original_name; In that case, .name will be an automatically generated unique name (e.g. “MyComponentName (1)”) while .original_name will remain what was originally set (e.g. “MyComponentName”)
If this component has a duplicate name and is moved to a component where none of its siblings share its name, the .name property will return the original “MyComponentName”