Class DataTypesXmlMgr

java.lang.Object
ghidra.app.util.xml.DataTypesXmlMgr

public class DataTypesXmlMgr extends Object
This manager is responsible for reading and writing datatypes in XML.
  • Constructor Details

    • DataTypesXmlMgr

      public DataTypesXmlMgr(DataTypeManager dataManager, MessageLog log)
      Constructs a new data types XML manager.
      Parameters:
      dataManager - the data type manager to read from or write to
      log - the message log for recording datatype warnings
  • Method Details

    • read

      public void read(XmlPullParser parser, TaskMonitor monitor) throws SAXParseException, CancelledException
      Reads the datatypes encoded in XML from the specified XML parser and recreates them in a datatype manager.
      Parameters:
      parser - the XML parser
      monitor - the task monitor
      Throws:
      SAXParseException - if an XML parse error occurs
      CancelledException - if the user cancels the read operation
    • write

      public void write(XmlWriter writer, TaskMonitor monitor) throws CancelledException
      Writes datatypes into XML using the specified XML writer.
      Parameters:
      writer - the XML writer
      monitor - the task monitor
      Throws:
      CancelledException - if the user cancels the write operation
    • writeAsXMLForDebug

      public static void writeAsXMLForDebug(DataTypeManager dataManager, String outputFilename) throws IOException
      Output data types in XML format for debugging purposes. NOTE: There is no support for reading the XML produced by this method.
      Parameters:
      dataManager - the data type manager
      outputFilename - name of the output file
      Throws:
      IOException - if there was a problem writing to the file