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
ConstructorDescriptionDataTypeCleaner
(DataTypeManager targetDtm, boolean retainExistingComposites) Consruct aDataTypeCleaner
instance. -
Method Summary
-
Constructor Details
-
DataTypeCleaner
Consruct aDataTypeCleaner
instance. The caller must ensure that this instance isclosed
when instance and any resultingDataType
is no longer in use.- Parameters:
targetDtm
- target datatype managerretainExistingComposites
- if true all composites will be checked against thetargetDtm
and 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-