Package ghidra.program.model.data
Class StandAloneDataTypeManager
- java.lang.Object
-
- ghidra.program.database.data.DataTypeManagerDB
-
- ghidra.program.model.data.StandAloneDataTypeManager
-
- All Implemented Interfaces:
DataTypeManager
- Direct Known Subclasses:
BuiltInDataTypeManager
,FileDataTypeManager
public class StandAloneDataTypeManager extends DataTypeManagerDB
Basic implementation of the DataTypeManger interface
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
-
Fields inherited from class ghidra.program.database.data.DataTypeManagerDB
dataOrganization, dbHandle, defaultListener, sourceArchiveAdapter, universalID
-
Fields 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
Constructors Modifier Constructor Description protected
StandAloneDataTypeManager(ResourceFile packedDbfile, int openMode)
Constructor for a data-type manager backed by a packed database file.StandAloneDataTypeManager(java.lang.String rootName)
Constructor for new temporary data-type manager using the default DataOrganization.StandAloneDataTypeManager(java.lang.String rootName, DataOrganization dataOrganzation)
Constructor for new temporary data-type manager using a specified DataOrganization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this dataType managerprotected void
deleteDataTypeIDs(java.util.LinkedList<java.lang.Long> deletedIds, TaskMonitor monitor)
void
endTransaction(int transactionID, boolean commit)
Ends the current transactionvoid
finalize()
void
flushEvents()
Force all pending notification events to be flushedDataOrganization
getDataOrganization()
Get the data organization associated with this data type manager.protected java.lang.String
getDomainFileID()
java.lang.String
getName()
Returns this data type manager's nameprotected java.lang.String
getPath()
ArchiveType
getType()
Returns this manager's archive typeprotected void
replaceDataTypeIDs(long oldID, long newID)
void
setName(java.lang.String name)
Sets this data type manager's nameint
startTransaction(java.lang.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, associateDataTypeWithArchive, categoryCreated, categoryMoved, categoryRemoved, categoryRenamed, clearAllSettings, clearSetting, clearSettings, contains, containsCategory, createCategory, dataTypeAdded, dataTypeChanged, dataTypeDeleted, dataTypeMoved, dataTypeNameChanged, dataTypeReplaced, dbError, deleteAddressRange, disassociate, dispose, doSourceArchiveUpdates, favoritesChanged, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, fixupComposites, getAllComposites, getAllDataTypes, getAllDataTypes, getAllStructures, getByteSettingsValue, getCategory, getCategory, getCategoryCount, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypes, getDataTypesContaining, getFavorites, getID, getLastChangeTimeForMyManager, getLocalSourceArchive, getLongSettingsValue, getNames, getPointer, getPointer, getResolvedID, getRootCategory, getSettings, getSourceArchive, getSourceArchive, getSourceArchives, getStringSettingsValue, getUniqueName, getUniqueName, getUniversalID, getUnusedConflictName, invalidateCache, isChanged, isCreatingDataType, isEmptySetting, isFavorite, isTransactionActive, isUpdatable, migrateOldFlexArrayComponentsIfRequired, moveAddressRange, remove, removeDataTypeManagerListener, removeInvalidatedListener, removeSourceArchive, replaceDataType, replaceSourceArchive, resolve, resolveSourceArchive, setByteSettingsValue, setFavorite, setLongSettingsValue, setSettings, setStringSettingsValue, sourceArchiveAdded, sourceArchiveChanged, updateID, updateSourceArchiveName, updateSourceArchiveName
-
-
-
-
Constructor Detail
-
StandAloneDataTypeManager
public StandAloneDataTypeManager(java.lang.String rootName)
Constructor for new temporary data-type manager using the default DataOrganization. Note that this manager does not support the save or saveAs operation.- Parameters:
rootName
- Name of the root category.
-
StandAloneDataTypeManager
public StandAloneDataTypeManager(java.lang.String rootName, DataOrganization dataOrganzation)
Constructor for new temporary data-type manager using a specified DataOrganization. Note that this manager does not support the save or saveAs operation.- Parameters:
rootName
- Name of the root category.dataOrganzation
- applicable data organization
-
StandAloneDataTypeManager
protected StandAloneDataTypeManager(ResourceFile packedDbfile, int openMode) throws java.io.IOException
Constructor for a data-type manager backed by a packed database file. When opening for UPDATE an automatic upgrade will be performed if required.- Parameters:
packedDbfile
- packed datatype archive file (i.e., *.gdt resource).openMode
- open mode CREATE, READ_ONLY or UPDATE (seeDBConstants
)- Throws:
java.io.IOException
- a low-level IO error. This exception may also be thrown when a version error occurs (cause is VersionException).
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:DataTypeManager
Returns this data type manager's name- Returns:
- the name
-
setName
public void setName(java.lang.String name) throws InvalidNameException
Description copied from interface:DataTypeManager
Sets this data type manager's name- Parameters:
name
- the new name- Throws:
InvalidNameException
- if the given name is invalid (such as when null or empty)
-
getDataOrganization
public final DataOrganization getDataOrganization()
Description copied from interface:DataTypeManager
Get the data organization associated with this data type manager. Note that the DataOrganization settings may not be changed dynamically.- Specified by:
getDataOrganization
in interfaceDataTypeManager
- Overrides:
getDataOrganization
in classDataTypeManagerDB
- Returns:
- data organization (will never be null)
-
startTransaction
public int startTransaction(java.lang.String description)
Description copied from interface:DataTypeManager
Starts a transaction for making changes in this data type manager.- Parameters:
description
- a short description of the changes to be made.- Returns:
- the transaction ID
-
flushEvents
public void flushEvents()
Description copied from interface:DataTypeManager
Force all pending notification events to be flushed
-
endTransaction
public void endTransaction(int transactionID, boolean commit)
Description copied from interface:DataTypeManager
Ends the current transaction- Parameters:
transactionID
- id of the transaction to endcommit
- true if changes are committed, false if changes in transaction are revoked
-
replaceDataTypeIDs
protected void replaceDataTypeIDs(long oldID, long newID)
- Specified by:
replaceDataTypeIDs
in classDataTypeManagerDB
-
deleteDataTypeIDs
protected void deleteDataTypeIDs(java.util.LinkedList<java.lang.Long> deletedIds, TaskMonitor monitor)
- Specified by:
deleteDataTypeIDs
in classDataTypeManagerDB
-
close
public void close()
Description copied from interface:DataTypeManager
Closes this dataType manager- Specified by:
close
in interfaceDataTypeManager
- Overrides:
close
in classDataTypeManagerDB
-
finalize
public void finalize()
- Overrides:
finalize
in classjava.lang.Object
-
getDomainFileID
protected java.lang.String getDomainFileID()
- Specified by:
getDomainFileID
in classDataTypeManagerDB
-
getPath
protected java.lang.String getPath()
- Specified by:
getPath
in classDataTypeManagerDB
-
getType
public ArchiveType getType()
Description copied from interface:DataTypeManager
Returns this manager's archive type- Returns:
- the type
-
-