Package ghidra.program.database.data
Class ProjectDataTypeManager
java.lang.Object
ghidra.program.database.data.DataTypeManagerDB
ghidra.program.database.data.ProjectDataTypeManager
- All Implemented Interfaces:
DataTypeManager,DomainFileBasedDataTypeManager,FileBasedDataTypeManager,ProjectArchiveBasedDataTypeManager
public class ProjectDataTypeManager
extends DataTypeManagerDB
implements ProjectArchiveBasedDataTypeManager
Class for managing data types in a project archive
NOTE: default data organization is used.
-
Field Summary
Fields 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 -
Constructor Summary
ConstructorsConstructorDescriptionProjectDataTypeManager(DBHandle handle, int openMode, ErrorHandler errHandler, Lock lock, TaskMonitor monitor) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidarchiveReady(int openMode, TaskMonitor monitor) protected voidcategoryCreated(Category newCategory) protected voidcategoryMoved(CategoryPath oldPath, Category category) protected voidcategoryRemoved(Category parent, String name, long categoryID) protected voidcategoryRenamed(CategoryPath oldPath, Category category) voidclose()Closes this dataType managerprotected voiddataTypeAdded(DataType newDt, DataType originalDataType) voiddataTypeChanged(DataType dt, boolean isAutoChange) Notification when data type is changed.protected voiddataTypeDeleted(long deletedID, DataTypePath deletedDataTypePath) protected voiddataTypeMoved(DataType dt, DataTypePath oldPath, DataTypePath newPath) protected voiddataTypeNameChanged(DataType dt, String oldName) protected voiddataTypeReplaced(long existingDtID, DataTypePath existingPath, DataType replacementDt) protected voiddeleteDataTypeIDs(LinkedList<Long> deletedIds, TaskMonitor monitor) voidendTransaction(int transactionID, boolean commit) Ends the current transactionprotected voidfavoritesChanged(DataType dataType, boolean isFavorite) voidForce all pending notification events to be flushedgetName()Returns this data type manager's namegetPath()getPointer(DataType dt) Returns a default sized pointer to the given datatype.getType()Returns this manager's archive typeprotected voidreplaceDataTypeIDs(long oldDataTypeID, long newDataTypeID) voidsetDataTypeArchive(DataTypeArchiveDB dtArchive) Set the associated ArchivevoidSets this data type manager's nameintstartTransaction(String description) Starts a transaction for making changes in this data type manager.Methods inherited from class ghidra.program.database.data.DataTypeManagerDB
addDataType, addDataTypeManagerListener, addDataTypes, addDataTypeToDelete, addInvalidatedListener, allowsDefaultBuiltInSettings, allowsDefaultComponentSettings, associateDataTypeWithArchive, contains, containsCategory, createCategory, dataTypeSettingsChanged, dbError, disassociate, dispose, doSourceArchiveUpdates, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, fixupComposites, getAllComposites, getAllDataTypes, getAllDataTypes, getAllStructures, getCategory, getCategory, getCategoryCount, getDataMap, getDataOrganization, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypes, getDataTypesContaining, getFavorites, getID, getLastChangeTimeForMyManager, getLocalSourceArchive, 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.program.model.data.DataTypeManager
addDataType, addDataTypeManagerListener, addDataTypes, addInvalidatedListener, allowsDefaultBuiltInSettings, allowsDefaultComponentSettings, associateDataTypeWithArchive, contains, containsCategory, createCategory, disassociate, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, getAllComposites, getAllDataTypes, getAllDataTypes, getAllStructures, getCategory, getCategory, getCategoryCount, getDataOrganization, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypesContaining, getFavorites, getID, getLastChangeTimeForMyManager, getLocalSourceArchive, getPointer, getResolvedID, getRootCategory, getSourceArchive, getSourceArchives, getUniqueName, getUniversalID, isFavorite, isUpdatable, remove, removeDataTypeManagerListener, removeInvalidatedListener, removeSourceArchive, replaceDataType, resolve, resolveSourceArchive, setFavorite, updateSourceArchiveName, updateSourceArchiveName
-
Constructor Details
-
ProjectDataTypeManager
public ProjectDataTypeManager(DBHandle handle, int openMode, ErrorHandler errHandler, Lock lock, TaskMonitor monitor) throws CancelledException, VersionException, IOException Constructor- Parameters:
handle- open database handleopenMode- the program open modeerrHandler- the database I/O error handlerlock- the program synchronization lockmonitor- the progress monitor- Throws:
CancelledException- if the user cancels an upgradeVersionException- if the database does not match the expected version.IOException- if a database I/O error occurs.
-
-
Method Details
-
setDataTypeArchive
Set the associated Archive- Parameters:
dtArchive- associated archive
-
getName
Description copied from interface:DataTypeManagerReturns this data type manager's name- Specified by:
getNamein interfaceDataTypeManager- Returns:
- the name
-
getPointer
Description copied from interface:DataTypeManagerReturns a default sized pointer to the given datatype. The pointer size is established dynamically based upon the data organization established by the compiler specification.- Specified by:
getPointerin interfaceDataTypeManager- Overrides:
getPointerin classDataTypeManagerDB- Parameters:
dt- the pointed to data type- Returns:
- the pointer
-
setName
Description copied from interface:DataTypeManagerSets this data type manager's name- Specified by:
setNamein interfaceDataTypeManager- Parameters:
name- the new name- Throws:
InvalidNameException- if the given name is invalid (such as when null or empty)
-
dataTypeChanged
Description copied from class:DataTypeManagerDBNotification when data type is changed.- Overrides:
dataTypeChangedin classDataTypeManagerDB- Parameters:
dt- data type that is changedisAutoChange- true if change was an automatic change in response to another datatype's change (e.g., size, alignment).
-
dataTypeAdded
- Overrides:
dataTypeAddedin classDataTypeManagerDB
-
dataTypeReplaced
protected void dataTypeReplaced(long existingDtID, DataTypePath existingPath, DataType replacementDt) - Overrides:
dataTypeReplacedin classDataTypeManagerDB
-
dataTypeDeleted
- Overrides:
dataTypeDeletedin classDataTypeManagerDB
-
dataTypeMoved
- Overrides:
dataTypeMovedin classDataTypeManagerDB
-
dataTypeNameChanged
- Overrides:
dataTypeNameChangedin classDataTypeManagerDB
-
categoryCreated
- Overrides:
categoryCreatedin classDataTypeManagerDB
-
categoryRenamed
- Overrides:
categoryRenamedin classDataTypeManagerDB
-
categoryRemoved
- Overrides:
categoryRemovedin classDataTypeManagerDB
-
categoryMoved
- Overrides:
categoryMovedin classDataTypeManagerDB
-
favoritesChanged
- Overrides:
favoritesChangedin classDataTypeManagerDB
-
replaceDataTypeIDs
protected void replaceDataTypeIDs(long oldDataTypeID, long newDataTypeID) - Specified by:
replaceDataTypeIDsin classDataTypeManagerDB
-
deleteDataTypeIDs
protected void deleteDataTypeIDs(LinkedList<Long> deletedIds, TaskMonitor monitor) throws CancelledException - Specified by:
deleteDataTypeIDsin classDataTypeManagerDB- Throws:
CancelledException
-
startTransaction
Description copied from interface:DataTypeManagerStarts a transaction for making changes in this data type manager.- Specified by:
startTransactionin interfaceDataTypeManager- Parameters:
description- a short description of the changes to be made.- Returns:
- the transaction ID
-
flushEvents
public void flushEvents()Description copied from interface:DataTypeManagerForce all pending notification events to be flushed- Specified by:
flushEventsin interfaceDataTypeManager
-
endTransaction
public void endTransaction(int transactionID, boolean commit) Description copied from interface:DataTypeManagerEnds the current transaction- Specified by:
endTransactionin interfaceDataTypeManager- Parameters:
transactionID- id of the transaction to endcommit- true if changes are committed, false if changes in transaction are revoked
-
getDomainFile
- Specified by:
getDomainFilein interfaceDomainFileBasedDataTypeManager
-
getDomainFileID
- Specified by:
getDomainFileIDin classDataTypeManagerDB
-
getPath
- Specified by:
getPathin interfaceFileBasedDataTypeManager- Specified by:
getPathin classDataTypeManagerDB
-
getType
Description copied from interface:DataTypeManagerReturns this manager's archive type- Specified by:
getTypein interfaceDataTypeManager- Returns:
- the type
-
archiveReady
- Throws:
IOExceptionCancelledException
-
close
public void close()Description copied from interface:DataTypeManagerCloses this dataType manager- Specified by:
closein interfaceDataTypeManager- Overrides:
closein classDataTypeManagerDB
-