Package ghidra.app.services

# Interface DataTypeArchiveService

All Known Subinterfaces:
  `DataTypeManagerService`

public interface DataTypeArchiveService
A service that manages a set of data type archives, allowing re-use of already open archives.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `closeArchive(DataTypeManager dtm)`
  Closes the archive for the given `DataTypeManager`.
  `DataTypeManager`
  `getBuiltInDataTypesManager()`
  Get the data type manager that has all of the built in types.
  `DataTypeManager[]`
  `getDataTypeManagers()`
  Gets the open data type managers.
  `DataTypeManager`
  `openArchive(ResourceFile file, boolean acquireWriteLock)`
  Opens the specified gdt (file based) data type archive.
  `DataTypeManager`
  `openArchive(DomainFile domainFile, TaskMonitor monitor)`
  Opens the specified project-located data type archive.
  `ghidra.app.plugin.core.datamgr.archive.Archive`
  `openArchive(DataTypeArchive dataTypeArchive)`
  Deprecated.
  `ghidra.app.plugin.core.datamgr.archive.Archive`
  `openArchive(File file, boolean acquireWriteLock)`
  Deprecated.
  `DataTypeManager`
  `openDataTypeArchive(String archiveName)`
  Opens a data type archive that was built into the Ghidra installation.

- ## Method Details

  - ### getBuiltInDataTypesManager

    DataTypeManager getBuiltInDataTypesManager()
    Get the data type manager that has all of the built in types.
    Returns:
      data type manager for built in data types

  - ### getDataTypeManagers

    DataTypeManager[] getDataTypeManagers()
    Gets the open data type managers.
    Returns:
      the open data type managers.

  - ### closeArchive

    void closeArchive(DataTypeManager dtm)
    Closes the archive for the given `DataTypeManager`. This will ignore request to close the open Program's manager and the built-in manager.
    Parameters:
      `dtm` - the data type manager of the archive to close

  - ### openDataTypeArchive

    DataTypeManager openDataTypeArchive(String archiveName) throws IOException, ghidra.app.plugin.core.datamgr.archive.DuplicateIdException
    Opens a data type archive that was built into the Ghidra installation.

    NOTE: This is predicated upon all archive files having a unique name within the installation.

    Any path prefix specified may prevent the file from opening (or reopening) correctly.

    Parameters:
      `archiveName` - archive file name (i.e., "generic_C_lib")
    Returns:
      the data type archive or null if an archive with the specified name can not be found.
    Throws:
      `IOException` - if an i/o error occurs opening the data type archive
      `ghidra.app.plugin.core.datamgr.archive.DuplicateIdException` - if another archive with the same ID is already open

  - ### openArchive

    DataTypeManager openArchive(ResourceFile file, boolean acquireWriteLock) throws IOException, ghidra.app.plugin.core.datamgr.archive.DuplicateIdException
    Opens the specified gdt (file based) data type archive.
    Parameters:
      `file` - gdt file
      `acquireWriteLock` - true if write lock should be acquired (i.e., open for update)
    Returns:
      the data type archive
    Throws:
      `IOException` - if an i/o error occurs opening the data type archive
      `ghidra.app.plugin.core.datamgr.archive.DuplicateIdException` - if another archive with the same ID is already open

  - ### openArchive

    DataTypeManager openArchive(DomainFile domainFile, TaskMonitor monitor) throws VersionException, CancelledException, IOException, ghidra.app.plugin.core.datamgr.archive.DuplicateIdException
    Opens the specified project-located data type archive.
    Parameters:
      `domainFile` - archive file located in the current project
      `monitor` - `TaskMonitor` to display progress during the opening
    Returns:
      the data type archive
    Throws:
      `IOException` - if an i/o error occurs opening the data type archive
      `ghidra.app.plugin.core.datamgr.archive.DuplicateIdException` - if another archive with the same ID is already open
      `VersionException` - if there is a version exception
      `CancelledException` - if the user cancels

  - ### openArchive

    @Deprecated ghidra.app.plugin.core.datamgr.archive.Archive openArchive(DataTypeArchive dataTypeArchive)
    Deprecated.
    A method to open an Archive for the given, pre-existing DataTypeArchive (like one that was opened during the import process.
    Parameters:
      `dataTypeArchive` - the archive from which to create an Archive
    Returns:
      an Archive based upon the given DataTypeArchive

  - ### openArchive

    @Deprecated ghidra.app.plugin.core.datamgr.archive.Archive openArchive(File file, boolean acquireWriteLock) throws IOException, ghidra.app.plugin.core.datamgr.archive.DuplicateIdException
    Deprecated.
    A method to open an Archive for the given, pre-existing archive file (*.gdt)
    Parameters:
      `file` - data type archive file
      `acquireWriteLock` - true if write lock should be acquired (i.e., open for update)
    Returns:
      an Archive based upon the given archive files
    Throws:
      `IOException` - if an i/o error occurs opening the data type archive
      `ghidra.app.plugin.core.datamgr.archive.DuplicateIdException` - if another archive with the same ID is already open