Package ghidra.program.util
Class DataTypeCleaner
java.lang.Object
ghidra.program.util.DataTypeCleaner
- All Implemented Interfaces:
Closeable,AutoCloseable
DataTypeCleaner provides a convenient way to clean composite definitions which may be
included within a complex datatype which was derived from an source unrelated to a target
DataTypeManager. The cleaning process entails clearing all details associated with
all composites other than their description which may be present. There is also an option
to retain those composites which are already defined within the target.
All datatypes and their referenced datatypes will be accumulated and possibly re-used across multiple invocations of the
clean(DataType) method. It is important that this instance
be closed when instance and any resulting DataType is no longer in use.-
Constructor Summary
ConstructorsConstructorDescriptionDataTypeCleaner(DataTypeManager targetDtm, boolean retainExistingComposites) Consruct aDataTypeCleanerinstance. -
Method Summary
-
Constructor Details
-
DataTypeCleaner
Consruct aDataTypeCleanerinstance. The caller must ensure that this instance isclosedwhen instance and any resultingDataTypeis no longer in use.- Parameters:
targetDtm- target datatype managerretainExistingComposites- if true all composites will be checked against thetargetDtmand retained if it already exists, otherwise all composites will be cleaned.
-
-
Method Details
-
clean
Clean the specified datatype- Parameters:
dt- datatype- Returns:
- clean datatype
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-