Package ghidra.program.model.data
Class FileDataTypeManager
java.lang.Object
ghidra.program.database.data.DataTypeManagerDB
ghidra.program.model.data.StandAloneDataTypeManager
ghidra.program.model.data.FileDataTypeManager
- All Implemented Interfaces:
DataTypeManager,FileArchiveBasedDataTypeManager,FileBasedDataTypeManager
public class FileDataTypeManager
extends StandAloneDataTypeManager
implements FileArchiveBasedDataTypeManager
DataTypeManager for a file. Can import categories from a file, or export
categories to a packed database.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringSuffix for an archive file.Fields inherited from class ghidra.program.model.data.StandAloneDataTypeManager
nameFields inherited from class ghidra.program.database.data.DataTypeManagerDB
addrMap, dataOrganization, dbHandle, defaultListener, errHandler, lock, sourceArchiveAdapter, universalIDFields inherited from interface ghidra.program.model.data.DataTypeManager
BAD_DATATYPE_ID, BUILT_IN_ARCHIVE_KEY, BUILT_IN_ARCHIVE_UNIVERSAL_ID, BUILT_IN_DATA_TYPES_NAME, DEFAULT_DATATYPE_ID, LOCAL_ARCHIVE_KEY, LOCAL_ARCHIVE_UNIVERSAL_ID, NULL_DATATYPE_ID -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this dataType managerstatic FileconvertFilename(File file) Convert the filename for the given file to have the packed database file extension.static FileDataTypeManagercreateFileArchive(File packedDbfile) Create a new data-type file archive using the default data organizationvoiddelete()static voidvoidfinalize()Get the filename for the current file.getPath()getType()Returns this manager's archive typebooleanisClosed()static FileDataTypeManageropenFileArchive(ResourceFile packedDbfile, boolean openForUpdate) Open an existing data-type file archive using the default data organizationstatic FileDataTypeManageropenFileArchive(File packedDbfile, boolean openForUpdate) Open an existing data-type file archive using the default data organizationvoidsave()Save the category to source file.voidSaves the data type manager to the given filevoidsaveAs(File saveFile, UniversalID newUniversalId) Saves the data type manager to the given file with a specific databaseId.toString()Methods inherited from class ghidra.program.model.data.StandAloneDataTypeManager
deleteDataTypeIDs, endTransaction, flushEvents, getDataOrganization, getDomainFileID, getName, replaceDataTypeIDs, setName, startTransactionMethods inherited from class ghidra.program.database.data.DataTypeManagerDB
addDataType, addDataTypeManagerListener, addDataTypes, addDataTypeToDelete, addInvalidatedListener, allowsDefaultBuiltInSettings, allowsDefaultComponentSettings, associateDataTypeWithArchive, categoryCreated, categoryMoved, categoryRemoved, categoryRenamed, contains, containsCategory, createCategory, dataTypeAdded, dataTypeChanged, dataTypeDeleted, dataTypeMoved, dataTypeNameChanged, dataTypeReplaced, dataTypeSettingsChanged, dbError, disassociate, dispose, doSourceArchiveUpdates, favoritesChanged, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, fixupComposites, getAllComposites, getAllDataTypes, getAllDataTypes, getAllStructures, getCategory, getCategory, getCategoryCount, getDataMap, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypes, getDataTypesContaining, getFavorites, getID, getLastChangeTimeForMyManager, getLocalSourceArchive, getPointer, getPointer, getResolvedID, getRootCategory, getSourceArchive, getSourceArchive, getSourceArchives, getUniqueName, getUniversalID, getUnusedConflictName, initializeOtherAdapters, invalidateCache, isChanged, isCreatingDataType, isFavorite, isTransactionActive, isUpdatable, migrateOldFlexArrayComponentsIfRequired, remove, removeDataTypeManagerListener, removeInvalidatedListener, removeSourceArchive, replaceDataType, replaceSourceArchive, resolve, resolveSourceArchive, setFavorite, sourceArchiveAdded, sourceArchiveChanged, updateID, updateSourceArchiveName, updateSourceArchiveNameMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.program.model.data.DataTypeManager
addDataType, addDataTypeManagerListener, addDataTypes, addInvalidatedListener, allowsDefaultBuiltInSettings, allowsDefaultComponentSettings, associateDataTypeWithArchive, contains, containsCategory, createCategory, disassociate, endTransaction, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, flushEvents, getAllComposites, getAllDataTypes, getAllDataTypes, getAllStructures, getCategory, getCategory, getCategoryCount, getDataOrganization, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypesContaining, getFavorites, getID, getLastChangeTimeForMyManager, getLocalSourceArchive, getName, getPointer, getPointer, getResolvedID, getRootCategory, getSourceArchive, getSourceArchives, getUniqueName, getUniversalID, isFavorite, isUpdatable, remove, removeDataTypeManagerListener, removeInvalidatedListener, removeSourceArchive, replaceDataType, resolve, resolveSourceArchive, setFavorite, setName, startTransaction, updateSourceArchiveName, updateSourceArchiveName
-
Field Details
-
EXTENSION
- See Also:
-
SUFFIX
Suffix for an archive file.- See Also:
-
-
Method Details
-
createFileArchive
Create a new data-type file archive using the default data organization- Parameters:
packedDbfile- archive file (filename must end with DataTypeFileManager.SUFFIX)- Returns:
- data-type manager backed by specified packedDbFile
- Throws:
IOException
-
openFileArchive
public static FileDataTypeManager openFileArchive(File packedDbfile, boolean openForUpdate) throws IOException Open an existing data-type file archive using the default data organization- Parameters:
packedDbfile- archive file (filename must end with DataTypeFileManager.SUFFIX)openForUpdate- if true archive will be open for update- Returns:
- data-type manager backed by specified packedDbFile
- Throws:
IOException
-
openFileArchive
public static FileDataTypeManager openFileArchive(ResourceFile packedDbfile, boolean openForUpdate) throws IOException Open an existing data-type file archive using the default data organization- Parameters:
packedDbfile- archive file (filename must end with DataTypeFileManager.SUFFIX)openForUpdate- if true archive will be open for update- Returns:
- data-type manager backed by specified packedDbFile
- Throws:
IOException
-
saveAs
public void saveAs(File saveFile, UniversalID newUniversalId) throws DuplicateFileException, IOException Saves the data type manager to the given file with a specific databaseId. NOTE: This method is intended for use in transforming one archive database to match another existing archive database.- Parameters:
saveFile- the file to savenewUniversalId- the new id to use- Throws:
DuplicateFileExceptionIOException
-
saveAs
Saves the data type manager to the given file- Parameters:
saveFile- the file to save- Throws:
DuplicateFileExceptionIOException
-
save
Save the category to source file.- Throws:
IOException
-
getFilename
Get the filename for the current file.- Returns:
- String filename, or null if there is no current file.
-
convertFilename
Convert the filename for the given file to have the packed database file extension.- Parameters:
file- file whose name is to be converted- Returns:
- file if the filename already ends in the packed database file extension, or a new File object that has the packed database file extension
-
delete
- Throws:
IOException
-
close
public void close()Description copied from interface:DataTypeManagerCloses this dataType manager- Specified by:
closein interfaceDataTypeManager- Overrides:
closein classStandAloneDataTypeManager
-
isClosed
public boolean isClosed() -
finalize
public void finalize()- Overrides:
finalizein classStandAloneDataTypeManager
-
delete
- Throws:
IOException
-
getPath
- Specified by:
getPathin interfaceFileBasedDataTypeManager- Overrides:
getPathin classStandAloneDataTypeManager
-
getType
Description copied from interface:DataTypeManagerReturns this manager's archive type- Specified by:
getTypein interfaceDataTypeManager- Overrides:
getTypein classStandAloneDataTypeManager- Returns:
- the type
-
toString
-