Package cppclassanalyzer.data.manager
Class ProjectClassTypeInfoManager
java.lang.Object
ghidra.program.database.data.DataTypeManagerDB
ghidra.program.database.data.ProjectDataTypeManager
cppclassanalyzer.data.manager.ProjectClassTypeInfoManager
- All Implemented Interfaces:
ClassTypeInfoManager,FileArchiveClassTypeInfoManager,ErrorHandler,DataTypeManager,DomainFileBasedDataTypeManager,FileBasedDataTypeManager,ProjectArchiveBasedDataTypeManager
public final class ProjectClassTypeInfoManager extends ProjectDataTypeManager implements FileArchiveClassTypeInfoManager
A ClassTypeInfoManager representing a project containing external libraries
-
Field Summary
Fields inherited from class ghidra.program.database.data.DataTypeManagerDB
dataOrganization, dbHandle, defaultListener, sourceArchiveAdapter, universalIDFields inherited from interface cppclassanalyzer.data.ClassTypeInfoManager
INVALID_KEYFields 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 Type Method Description voidaddListener(DomainObjectListener listener)voidclose()voidexecuteCommand(PluginTool tool, BackgroundCommand cmd)Executes the provided background command in the provided tool on this manager.Stream<LibraryClassTypeInfoManager>getAvailableManagers(String[] names)Gets a stream of all available managers with the provided namesStream<LibraryClassTypeInfoManager>getAvailableManagers(Collection<String> names)Gets a stream of all available managers with the provided namesIcongetIcon(boolean expanded)Gets the icon for this manager to be used in theTypeInfoArchiveGTreeCollection<LibraryClassTypeInfoManager>getLibraries()Gets a collection of libraries contained within this project managerLibraryClassTypeInfoManagergetLibrary(String name)Gets the library in this project with the specified nameClassTypeInfoManagerPlugingetPlugin()<T extends ArchivedRttiData>
TgetRttiData(Class<T> clazz, String symbolName)TypeInfoTreeNodeManagergetTreeNodeManager()Gets theTypeInfoTreeNodeManagerfor this ClassTypeInfoManagerClassTypeInfoDBgetType(long key)Gets the ClassTypeInfo for the corresponding database keyClassTypeInfoDBgetType(Function fun)Gets the ClassTypeInfo for the correspondingFunctionClassTypeInfoDBgetType(GhidraClass gc)Gets the ClassTypeInfo for the correspondingGhidraClassClassTypeInfoDBgetType(String symbolName)Gets the ClassTypeInfo with the specified symbol.ClassTypeInfoDBgetType(String name, Namespace namespace)Gets the ClassTypeInfo with the specified name andNamespaceintgetTypeCount()Gets the number of managed ClassTypeInfosIterable<ClassTypeInfoDB>getTypes()Gets an iterable over all the managed ClassTypeInfosStream<ClassTypeInfoDB>getTypeStream()Gets a stream of all the managed ClassTypeInfosstatic voidinit(ProjectArchive archive)Initialize theProjectArchiveas a ClassTypeInfoManagervoidinsert(ClassTypeInfoManager manager, TaskMonitor monitor)Inserts a ClassTypeInfoManager into this projectvoidinsert(Collection<? extends ClassTypeInfoManager> managers, TaskMonitor monitor)Inserts the collection of managers into this projectbooleanisModifiable()Checks if the manager can be changedstatic ProjectClassTypeInfoManageropen(ClassTypeInfoManagerService service, ProjectArchive archive)static FileArchiveClassTypeInfoManageropenIfManagerArchive(ClassTypeInfoManagerPlugin plugin, Archive archive)Opens the Archive iff it contains a ProjectClassTypeInfoManagervoidremoveListener(DomainObjectListener listener)ClassTypeInfoDBresolve(ClassTypeInfo type)Returns a ClassTypeInfo that is managed by this ClassTypeInfoManager.voidsave()Saves all changed dataMethods inherited from class ghidra.program.database.data.ProjectDataTypeManager
archiveReady, categoryCreated, categoryMoved, categoryRemoved, categoryRenamed, dataTypeAdded, dataTypeChanged, dataTypeDeleted, dataTypeMoved, dataTypeNameChanged, dataTypeReplaced, deleteDataTypeIDs, endTransaction, favoritesChanged, flushEvents, getDomainFile, getDomainFileID, getName, getPath, getPointer, getType, replaceDataTypeIDs, setDataTypeArchive, setName, startTransactionMethods inherited from class ghidra.program.database.data.DataTypeManagerDB
addDataType, addDataTypeManagerListener, addDataTypes, addDataTypeToDelete, addInvalidatedListener, associateDataTypeWithArchive, clearAllSettings, clearSetting, clearSettings, contains, containsCategory, createCategory, dbError, deleteAddressRange, disassociate, dispose, doSourceArchiveUpdates, findDataType, findDataTypeForID, findDataTypes, findDataTypes, findEnumValueNames, fixupComposites, getAllComposites, getAllDataTypes, getAllDataTypes, getAllStructures, getByteSettingsValue, getCategory, getCategory, getCategoryCount, getDataOrganization, getDataType, getDataType, getDataType, getDataType, getDataType, getDataTypeCount, getDataTypes, getDataTypes, getDataTypesContaining, getFavorites, getID, getLastChangeTimeForMyManager, getLocalSourceArchive, getLongSettingsValue, getNames, getPointer, getResolvedID, getRootCategory, getSettings, getSourceArchive, getSourceArchive, getSourceArchives, getStringSettingsValue, getUniqueName, getUniqueName, getUniversalID, getUnusedConflictName, invalidateCache, isChanged, isCreatingDataType, isEmptySetting, isFavorite, isTransactionActive, isUpdatable, moveAddressRange, remove, removeDataTypeManagerListener, removeInvalidatedListener, removeSourceArchive, replaceDataType, replaceSourceArchive, resolve, resolveSourceArchive, setByteSettingsValue, setFavorite, setLongSettingsValue, setSettings, setStringSettingsValue, 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 cppclassanalyzer.data.ClassTypeInfoManager
getNameMethods inherited from interface ghidra.program.model.data.DataTypeManager
addDataType, addDataTypeManagerListener, addDataTypes, addInvalidatedListener, associateDataTypeWithArchive, contains, containsCategory, createCategory, dataTypeChanged, 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, getType, getUniqueName, getUniversalID, isFavorite, isUpdatable, remove, removeDataTypeManagerListener, removeInvalidatedListener, removeSourceArchive, replaceDataType, resolve, resolveSourceArchive, setFavorite, setName, startTransaction, updateSourceArchiveName, updateSourceArchiveNameMethods inherited from interface db.util.ErrorHandler
dbErrorMethods inherited from interface cppclassanalyzer.data.manager.FileArchiveClassTypeInfoManager
isChangedMethods inherited from interface ghidra.program.model.data.FileBasedDataTypeManager
getPath
-
Method Details
-
open
public static ProjectClassTypeInfoManager open(ClassTypeInfoManagerService service, ProjectArchive archive) throws IOException- Throws:
IOException
-
resolve
Description copied from interface:ClassTypeInfoManagerReturns a ClassTypeInfo that is managed by this ClassTypeInfoManager. If one does not currently exist a new one is created.- Specified by:
resolvein interfaceClassTypeInfoManager- Parameters:
type- the type to resolve- Returns:
- the equivalent type managed by this ClassTypeInfoManager
-
getType
Description copied from interface:ClassTypeInfoManagerGets the ClassTypeInfo for the correspondingGhidraClass- Specified by:
getTypein interfaceClassTypeInfoManager- Parameters:
gc- the GhidraClass- Returns:
- the ClassTypeInfo or null if it doesn't exist
- Throws:
UnresolvedClassTypeInfoException- if this type requires a copy relocation which cannot be resolved.
-
getType
Description copied from interface:ClassTypeInfoManagerGets the ClassTypeInfo for the correspondingFunction- Specified by:
getTypein interfaceClassTypeInfoManager- Parameters:
fun- the function- Returns:
- the ClassTypeInfo or null if it doesn't exist
- Throws:
UnresolvedClassTypeInfoException- if this type requires a copy relocation which cannot be resolved.
-
getType
public ClassTypeInfoDB getType(String name, Namespace namespace) throws UnresolvedClassTypeInfoExceptionDescription copied from interface:ClassTypeInfoManagerGets the ClassTypeInfo with the specified name andNamespace- Specified by:
getTypein interfaceClassTypeInfoManager- Parameters:
name- the type's namenamespace- the type's namespace- Returns:
- the ClassTypeInfo or null if it doesn't exist
- Throws:
UnresolvedClassTypeInfoException- if this type requires a copy relocation which cannot be resolved.
-
getType
Description copied from interface:ClassTypeInfoManagerGets the ClassTypeInfo with the specified symbol. The supplied symbol should be mangled.- Specified by:
getTypein interfaceClassTypeInfoManager- Parameters:
symbolName- the mangled symbol name- Returns:
- the ClassTypeInfo or null if it doesn't exist
- Throws:
UnresolvedClassTypeInfoException- if this type requires a copy relocation which cannot be resolved.
-
getTypes
Description copied from interface:ClassTypeInfoManagerGets an iterable over all the managed ClassTypeInfos- Specified by:
getTypesin interfaceClassTypeInfoManager- Returns:
- an iterable over all the managed ClassTypeInfos
-
getTypeStream
Description copied from interface:ClassTypeInfoManagerGets a stream of all the managed ClassTypeInfos- Specified by:
getTypeStreamin interfaceClassTypeInfoManager- Returns:
- a stream of all the managed ClassTypeInfos
-
getTypeCount
public int getTypeCount()Description copied from interface:ClassTypeInfoManagerGets the number of managed ClassTypeInfos- Specified by:
getTypeCountin interfaceClassTypeInfoManager- Returns:
- the number of managed ClassTypeInfos
-
getPlugin
- Specified by:
getPluginin interfaceFileArchiveClassTypeInfoManager
-
getIcon
Description copied from interface:ClassTypeInfoManagerGets the icon for this manager to be used in theTypeInfoArchiveGTree- Specified by:
getIconin interfaceClassTypeInfoManager- Parameters:
expanded- true if the manager tree node is expanded- Returns:
- the icon to be used in the tree
-
isModifiable
public boolean isModifiable()Description copied from interface:FileArchiveClassTypeInfoManagerChecks if the manager can be changed- Specified by:
isModifiablein interfaceFileArchiveClassTypeInfoManager- Returns:
- true if the manager can be changed
-
save
public void save()Description copied from interface:FileArchiveClassTypeInfoManagerSaves all changed data- Specified by:
savein interfaceFileArchiveClassTypeInfoManager
-
getLibraries
Gets a collection of libraries contained within this project manager- Returns:
- the collection of libraries
-
getLibrary
Gets the library in this project with the specified name- Parameters:
name- the name of the library- Returns:
- the library manager or null if none exists
-
getTreeNodeManager
Description copied from interface:ClassTypeInfoManagerGets theTypeInfoTreeNodeManagerfor this ClassTypeInfoManager- Specified by:
getTreeNodeManagerin interfaceClassTypeInfoManager- Returns:
- this manager's TypeInfoTreeNodeManager
-
getType
Description copied from interface:ClassTypeInfoManagerGets the ClassTypeInfo for the corresponding database key- Specified by:
getTypein interfaceClassTypeInfoManager- Parameters:
key- the database key- Returns:
- the ClassTypeInfo or null if it doesn't exist
-
addListener
- Specified by:
addListenerin interfaceClassTypeInfoManager
-
removeListener
- Specified by:
removeListenerin interfaceClassTypeInfoManager
-
insert
Inserts a ClassTypeInfoManager into this project- Parameters:
manager- the manager to insertmonitor- the current task monitor- Throws:
CancelledException- if the operation is cancelled
-
insert
public void insert(Collection<? extends ClassTypeInfoManager> managers, TaskMonitor monitor) throws CancelledExceptionInserts the collection of managers into this project- Parameters:
managers- the collection of managers to insertmonitor- the current task monitor- Throws:
CancelledException- if the operation is cancelled
-
executeCommand
Executes the provided background command in the provided tool on this manager.- Parameters:
tool- the plugin toolcmd- the background command
-
close
public void close()- Specified by:
closein interfaceDataTypeManager- Overrides:
closein classProjectDataTypeManager
-
init
Initialize theProjectArchiveas a ClassTypeInfoManager- Parameters:
archive- the project archive- Throws:
IOException- if an error occurs initializing the archive
-
getRttiData
-
openIfManagerArchive
public static FileArchiveClassTypeInfoManager openIfManagerArchive(ClassTypeInfoManagerPlugin plugin, Archive archive) throws IOExceptionOpens the Archive iff it contains a ProjectClassTypeInfoManager- Parameters:
plugin- the pluginarchive- the archive to open- Returns:
- the manager or null if it did not contain one
- Throws:
IOException- if an error occurs opening the archive
-
getAvailableManagers
Gets a stream of all available managers with the provided names- Parameters:
names- the names of the libraries to get- Returns:
- a stream of all available specified libraries
-
getAvailableManagers
Gets a stream of all available managers with the provided names- Parameters:
names- the names of the libraries to get- Returns:
- a stream of all available specified libraries
- See Also:
getAvailableManagers(Collection)
-