Class FileDataTypeManager
- All Implemented Interfaces:
- DataTypeManager,- FileArchiveBasedDataTypeManager,- FileBasedDataTypeManager,- Closeable,- AutoCloseable
- 
Nested Class SummaryNested classes/interfaces inherited from class ghidra.program.model.data.StandAloneDataTypeManagerStandAloneDataTypeManager.ArchiveWarning, StandAloneDataTypeManager.ArchiveWarningLevel, StandAloneDataTypeManager.LanguageUpdateOption
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final GhidraFileFilterstatic final StringSuffix for an archive file.Fields inherited from class ghidra.program.model.data.StandAloneDataTypeManagernameFields inherited from class ghidra.program.database.data.DataTypeManagerDBaddrMap, dbHandle, DEFAULT_CALLING_CONVENTION_ID, defaultListener, errHandler, lock, readOnlyMode, sourceArchiveAdapter, tablePrefix, universalID, UNKNOWN_CALLING_CONVENTION_IDFields inherited from interface ghidra.program.model.data.DataTypeManagerBAD_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 SummaryModifier 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 organizationstatic FileDataTypeManagercreateFileArchive(File packedDbFile, LanguageID languageId, CompilerSpecID compilerSpecId) Create a new data-type file archive using the default data organization.static FileDataTypeManagercreateFileArchive(File packedDbfile, String languageId, String compilerSpecId) Create a new data-type file archive using the default data organization.voiddelete()static voidvoidfinalize()Get the filename for the current file.getPath()Get the path name associated with the storage of this stand alone datatype manager.getType()Returns this manager's archive typebooleanisClosed()static FileDataTypeManageropenFileArchive(ResourceFile packedDbfile, boolean openForUpdate) Open an existing data-type file archive using the default data organization.static FileDataTypeManageropenFileArchive(File packedDbfile, boolean openForUpdate) Open an existing data-type file archive using the default data organization.voidsave()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.StandAloneDataTypeManagercanRedo, canUndo, clearProgramArchitecture, clearUndo, deleteDataTypesUsed, endTransaction, flushEvents, getAllRedoNames, getAllUndoNames, getDomainFileID, getName, getProgramArchitectureSummary, getRedoName, getTransactionCount, getUndoName, getWarning, getWarningDetail, getWarningMessage, handleDataOrganizationChange, initializeOtherAdapters, initTransactionState, isArchitectureChangeAllowed, isProgramArchitectureMissing, isProgramArchitectureUpgradeRequired, logWarning, openTransaction, redo, replaceDataTypesUsed, setImmutable, setName, setProgramArchitecture, setProgramArchitecture, startTransaction, undoMethods inherited from class ghidra.program.database.data.DataTypeManagerDBaddDataType, addDataTypeManagerListener, addDataTypes, addDataTypeToDelete, addDataTypeToReplace, addInvalidatedListener, allowsDefaultBuiltInSettings, allowsDefaultComponentSettings, associateDataTypeWithArchive, categoryCreated, categoryMoved, categoryRemoved, categoryRenamed, compilerSpecChanged, contains, containsCategory, createCategory, dataTypeAdded, dataTypeChanged, dataTypeDeleted, dataTypeMoved, dataTypeNameChanged, dataTypeReplaced, dataTypeSettingsChanged, dbError, dedupeAllConflicts, dedupeConflicts, disassociate, dispose, doSourceArchiveUpdates, favoritesChanged, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, fixupComposites, getAddressMap, getAllComposites, getAllDataTypes, getAllDataTypes, getAllFunctionDefinitions, getAllStructures, getCallingConvention, getCallingConventionID, getCallingConventionName, getCategory, getCategory, getCategoryCount, getChildIds, getDataMap, getDataOrganization, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypes, getDataTypesContaining, getDefaultCallingConvention, getDefinedCallingConventionNames, getFavorites, getID, getKnownCallingConventionNames, getLastChangeTimeForMyManager, getLocalSourceArchive, getPointer, getPointer, getProgramArchitecture, getProgramArchitectureSummary, getResolvedID, getRootCategory, getSourceArchive, getSourceArchive, getSourceArchives, getUniqueName, getUniversalID, getUnusedConflictName, getUnusedConflictName, getVariableStorageManager, hasDataOrganizationChange, hasParent, invalidateCache, isChanged, isCreatingDataType, isFavorite, isTransactionActive, isUpdatable, migrateOldFlexArrayComponentsIfRequired, notifyRestored, readDataOrganization, remove, removeDataTypeManagerListener, removeInvalidatedListener, removeParentChildRecord, removeSourceArchive, replaceDataType, replaceSourceArchive, resolve, resolveSourceArchive, saveDataOrganization, setFavorite, sourceArchiveAdded, sourceArchiveChanged, updateID, updateLastChangeTime, updateSourceArchiveName, updateSourceArchiveNameMethods inherited from class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.program.model.data.DataTypeManageraddDataType, addDataTypeManagerListener, addDataTypes, addInvalidatedListener, allowsDefaultBuiltInSettings, allowsDefaultComponentSettings, associateDataTypeWithArchive, contains, containsCategory, createCategory, disassociate, endTransaction, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, flushEvents, getAddressMap, getAllComposites, getAllDataTypes, getAllDataTypes, getAllFunctionDefinitions, getAllStructures, getCallingConvention, getCategory, getCategory, getCategoryCount, getDataOrganization, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypesContaining, getDefaultCallingConvention, getDefinedCallingConventionNames, getFavorites, getID, getKnownCallingConventionNames, getLastChangeTimeForMyManager, getLocalSourceArchive, getName, getPointer, getPointer, getProgramArchitecture, getProgramArchitectureSummary, getResolvedID, getRootCategory, getSourceArchive, getSourceArchives, getUniqueName, getUniversalID, isFavorite, isUpdatable, openTransaction, remove, removeDataTypeManagerListener, removeInvalidatedListener, removeSourceArchive, replaceDataType, resolve, resolveSourceArchive, setFavorite, setName, startTransaction, updateSourceArchiveName, updateSourceArchiveName, withTransaction, withTransaction
- 
Field Details- 
EXTENSION- See Also:
 
- 
GDT_FILEFILTER
- 
SUFFIXSuffix for an archive file.- See Also:
 
 
- 
- 
Method Details- 
createFileArchiveCreate 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- if an IO error occurs
 
- 
createFileArchivepublic static FileDataTypeManager createFileArchive(File packedDbFile, LanguageID languageId, CompilerSpecID compilerSpecId) throws LanguageNotFoundException, CompilerSpecNotFoundException, IOException Create a new data-type file archive using the default data organization.- Parameters:
- packedDbFile- archive file (filename must end with DataTypeFileManager.SUFFIX)
- languageId- valid language ID (see appropriate *.ldefs file for defined IDs)
- compilerSpecId- valid compiler spec ID which corresponds to the language ID.
- Returns:
- data-type manager backed by the specified packedDbFile
- Throws:
- DuplicateFileException- if- packedDbFilealready exists
- LanguageNotFoundException- if specified- languageIdnot defined.
- CompilerSpecNotFoundException- if specified- compilerSpecIdis not defined for the specified language.
- IOException- if an IO error occurs
 
- 
createFileArchivepublic static FileDataTypeManager createFileArchive(File packedDbfile, String languageId, String compilerSpecId) throws IOException Create a new data-type file archive using the default data organization.- Parameters:
- packedDbfile- archive file (filename must end with DataTypeFileManager.SUFFIX)
- languageId- valid language ID (see appropriate *.ldefs file for defined IDs). If null invocation will be deferred to- createFileArchive(File).
- compilerSpecId- valid compiler spec ID which corresponds to the language ID.
- Returns:
- data-type manager backed by the specified packedDbFile
- Throws:
- LanguageNotFoundException- if specified- languageIdnot defined.
- CompilerSpecNotFoundException- if specified- compilerSpecIdis not defined for the specified language.
- IOException- if an IO error occurs
 
- 
openFileArchivepublic static FileDataTypeManager openFileArchive(File packedDbfile, boolean openForUpdate) throws IOException Open an existing data-type file archive using the default data organization.NOTE: If archive has an assigned architecture, issues may arise due to a revised or missing Language/CompilerSpecwhich will result in a warning but not prevent the archive from being opened. Such a warning condition will ne logged and may result in missing or stale information for existing datatypes which have architecture related data. In some case it may be appropriate tocheck for warningson the returned archive object prior to its use.- 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- if an IO error occurs
 
- 
openFileArchivepublic static FileDataTypeManager openFileArchive(ResourceFile packedDbfile, boolean openForUpdate) throws IOException Open an existing data-type file archive using the default data organization.NOTE: If archive has an assigned architecture, issues may arise due to a revised or missing Language/CompilerSpecwhich will result in a warning but not prevent the archive from being opened. Such a warning condition will ne logged and may result in missing or stale information for existing datatypes which have architecture related data. In some case it may be appropriate tocheck for warningson the returned archive object prior to its use.- 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- if an IO error occurs
 
- 
saveAspublic 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 save
- newUniversalId- the new id to use
- Throws:
- DuplicateFileException- if save file already exists
- IOException- if IO error occurs
 
- 
saveAsSaves the data type manager to the given file- Parameters:
- saveFile- the file to save
- Throws:
- DuplicateFileException- if save file already exists
- IOException- if IO error occurs
 
- 
saveSave the category to source file.- Throws:
- IOException- if IO error occurs
 
- 
getFilenameGet the filename for the current file.- Returns:
- String filename, or null if there is no current file.
 
- 
convertFilenameConvert 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
 
- 
closepublic void close()Description copied from interface:DataTypeManagerCloses this dataType manager- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein interface- DataTypeManager
- Overrides:
- closein class- StandAloneDataTypeManager
 
- 
isClosedpublic boolean isClosed()
- 
finalizepublic void finalize()- Overrides:
- finalizein class- StandAloneDataTypeManager
 
- 
delete- Throws:
- IOException
 
- 
getPathDescription copied from class:StandAloneDataTypeManagerGet the path name associated with the storage of this stand alone datatype manager.- Specified by:
- getPathin interface- FileBasedDataTypeManager
- Overrides:
- getPathin class- StandAloneDataTypeManager
- Returns:
- path name or null if not applicable
 
- 
getTypeDescription copied from interface:DataTypeManagerReturns this manager's archive type- Specified by:
- getTypein interface- DataTypeManager
- Overrides:
- getTypein class- StandAloneDataTypeManager
- Returns:
- the type
 
- 
toString
 
-