Class GzfExporter
- All Implemented Interfaces:
ExtensionPoint
-
Field Summary
Fields inherited from class ghidra.app.util.exporter.Exporter
EMPTY_OPTIONS, log, provider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canExportDomainFile
(DomainFile domainFile) Returns true if exporter can export the specifiedDomainFile
without instantiating aDomainObject
.boolean
canExportDomainObject
(Class<? extends DomainObject> domainObjectClass) Returns true if this exporter is capable of exporting the given domain file/object content type.boolean
boolean
export
(File file, DomainFile domainFile, TaskMonitor monitor) Actually does the work of exporting a domain file, if supported (seeExporter.canExportDomainFile(DomainFile)
).boolean
export
(File file, DomainObject domainObj, AddressSetView addrSet, TaskMonitor monitor) Actually does the work of exporting aDomainObject
.getOptions
(DomainObjectService domainObjectService) Returns the available options for this exporter.void
setOptions
(List<Option> options) Sets the options.boolean
Returns false.Methods inherited from class ghidra.app.util.exporter.Exporter
canExportDomainObject, getDefaultFileExtension, getHelpLocation, getMessageLog, getName, setExporterServiceProvider, toString
-
Field Details
-
EXTENSION
- See Also:
-
SUFFIX
- See Also:
-
NAME
- See Also:
-
-
Constructor Details
-
GzfExporter
public GzfExporter()
-
-
Method Details
-
canExportDomainFile
Description copied from class:Exporter
Returns true if exporter can export the specifiedDomainFile
without instantiating aDomainObject
. This method should be used prior to exporting using theExporter.export(File, DomainFile, TaskMonitor)
method. All exporter capable of aDomainFile
export must also support a export of aDomainObject
so that any possible data modification/upgrade is included within resulting export.- Overrides:
canExportDomainFile
in classExporter
- Parameters:
domainFile
- domain file- Returns:
- true if export can occur else false if not
-
canExportDomainObject
Description copied from class:Exporter
Returns true if this exporter is capable of exporting the given domain file/object content type. For example, some exporters have the ability to export programs, other exporters can export project data type archives.NOTE: This method should only be used as a preliminary check, if neccessary, to identify exporter implementations that are capable of handling a specified content type/class. Prior to export a final check should be performed based on the export or either a
DomainFile
orDomainObject
:DomainFile
export - the methodExporter.canExportDomainFile(DomainFile)
should be used to verify a direct project file export is possible using theExporter.export(File, DomainFile, TaskMonitor)
method.DomainObject
export - the methodExporter.canExportDomainObject(DomainObject)
should be used to verify an export of a specific object is possible using theExporter.export(File, DomainObject, AddressSetView, TaskMonitor)
method. avoid opening DomainFile when possible.- Overrides:
canExportDomainObject
in classExporter
- Parameters:
domainObjectClass
- the class of the domain object to test for exporting.- Returns:
- true if this exporter knows how to export the given domain object type.
-
equals
-
export
public boolean export(File file, DomainObject domainObj, AddressSetView addrSet, TaskMonitor monitor) Description copied from class:Exporter
Actually does the work of exporting aDomainObject
. Export will include all saved and unsaved modifications which may have been made to the object.- Specified by:
export
in classExporter
- Parameters:
file
- the output file to write the exported infodomainObj
- the domain object to exportaddrSet
- the address set if only a portion of the program should be exported NOTE: seeExporter.supportsAddressRestrictedExport()
.monitor
- the task monitor- Returns:
- true if the program was successfully exported; otherwise, false. If the program was not successfully exported, the message log should be checked to find the source of the error.
-
export
public boolean export(File file, DomainFile domainFile, TaskMonitor monitor) throws ExporterException, IOException Description copied from class:Exporter
Actually does the work of exporting a domain file, if supported (seeExporter.canExportDomainFile(DomainFile)
). Export is performed without instantiation of aDomainObject
.- Overrides:
export
in classExporter
- Parameters:
file
- the output file to write the exported infodomainFile
- the domain file to be exported (e.g., packed DB file)monitor
- the task monitor- Returns:
- true if the file was successfully exported; otherwise, false. If the file was not successfully exported, the message log should be checked to find the source of the error.
- Throws:
ExporterException
- if export error occursIOException
- if an IO error occurs
-
getOptions
Description copied from class:Exporter
Returns the available options for this exporter. The program is needed because some exporters may have options that vary depending on the specific program being exported.- Specified by:
getOptions
in classExporter
- Parameters:
domainObjectService
- a service for retrieving the applicable domainObject.- Returns:
- the available options for this exporter
-
setOptions
Description copied from class:Exporter
Sets the options. This method is not for defining the options, but rather it is for setting the values of options. If invalid options are passed in, then OptionException should be thrown.- Specified by:
setOptions
in classExporter
- Parameters:
options
- the option values for this exporter
-
supportsAddressRestrictedExport
public boolean supportsAddressRestrictedExport()Returns false. GZF export only supports entire database.- Overrides:
supportsAddressRestrictedExport
in classExporter
- Returns:
- true if this exporter can export less than the entire domain file.
-