Package ghidra.program.model.data
Class DataTypeWriter
java.lang.Object
ghidra.program.model.data.DataTypeWriter
A class used to convert data types into ANSI-C.
The ANSI-C code should compile on most platforms.
-
Constructor Summary
ConstructorDescriptionDataTypeWriter
(DataTypeManager dtm, Writer writer) Constructs a new instance of this class using the given writer.DataTypeWriter
(DataTypeManager dtm, Writer writer, boolean cppStyleComments) Constructs a new instance of this class using the given writer.DataTypeWriter
(DataTypeManager dtm, Writer writer, AnnotationHandler annotator) Constructs a new instance of this class using the given writer and annotation handlerDataTypeWriter
(DataTypeManager dtm, Writer writer, AnnotationHandler annotator, boolean cppStyleComments) Constructs a new instance of this class using the given writer and annotation handler -
Method Summary
Modifier and TypeMethodDescriptionvoid
write
(Category category, TaskMonitor monitor) Converts all data types in the category into ANSI-C code.void
write
(DataType[] dataTypes, TaskMonitor monitor) Converts all data types in the array into ANSI-C code.void
write
(DataTypeManager dataTypeManager, TaskMonitor monitor) Converts all data types in the data type manager into ANSI-C code.void
write
(List<DataType> dataTypes, TaskMonitor monitor) Converts all data types in the list into ANSI-C code.void
write
(List<DataType> dataTypes, TaskMonitor monitor, boolean throwExceptionOnInvalidType)
-
Constructor Details
-
DataTypeWriter
Constructs a new instance of this class using the given writer. The default annotation handler is used.- Parameters:
dtm
- data-type manager corresponding to target program or null for defaultwriter
- the writer to use when writing data types- Throws:
IOException
- if there is an exception writing the output
-
DataTypeWriter
public DataTypeWriter(DataTypeManager dtm, Writer writer, boolean cppStyleComments) throws IOException Constructs a new instance of this class using the given writer. The default annotation handler is used.- Parameters:
dtm
- data-type manager corresponding to target program or null for defaultwriter
- the writer to use when writing data typescppStyleComments
- whether to use C++ style comments- Throws:
IOException
- if there is an exception writing the output
-
DataTypeWriter
public DataTypeWriter(DataTypeManager dtm, Writer writer, AnnotationHandler annotator) throws IOException Constructs a new instance of this class using the given writer and annotation handler- Parameters:
dtm
- data-type manager corresponding to target program or null for defaultwriter
- the writer to use when writing data typesannotator
- the annotation handler to use to annotate the data types- Throws:
IOException
- if there is an exception writing the output
-
DataTypeWriter
public DataTypeWriter(DataTypeManager dtm, Writer writer, AnnotationHandler annotator, boolean cppStyleComments) throws IOException Constructs a new instance of this class using the given writer and annotation handler- Parameters:
dtm
- data-type manager corresponding to target program or null for defaultwriter
- the writer to use when writing data typesannotator
- the annotation handler to use to annotate the data typescppStyleComments
- whether to use C++ style comments- Throws:
IOException
- if there is an exception writing the output
-
-
Method Details
-
write
public void write(DataTypeManager dataTypeManager, TaskMonitor monitor) throws IOException, CancelledException Converts all data types in the data type manager into ANSI-C code.- Parameters:
dataTypeManager
- the manager containing the data types to writemonitor
- the task monitor- Throws:
IOException
- if there is an exception writing the outputCancelledException
- if the action is cancelled by the user
-
write
Converts all data types in the category into ANSI-C code.- Parameters:
category
- the category containing the datatypes to writemonitor
- the task monitor- Throws:
IOException
- if there is an exception writing the outputCancelledException
- if the action is cancelled by the user
-
write
Converts all data types in the array into ANSI-C code.- Parameters:
dataTypes
- the data types to writemonitor
- the task monitor- Throws:
IOException
- if there is an exception writing the outputCancelledException
- if the action is cancelled by the user
-
write
public void write(List<DataType> dataTypes, TaskMonitor monitor) throws IOException, CancelledException Converts all data types in the list into ANSI-C code.- Parameters:
dataTypes
- the data types to writemonitor
- the task monitor- Throws:
IOException
- if there is an exception writing the outputCancelledException
- if the action is cancelled by the user
-
write
public void write(List<DataType> dataTypes, TaskMonitor monitor, boolean throwExceptionOnInvalidType) throws IOException, CancelledException - Throws:
IOException
CancelledException
-