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, universalID
Fields inherited from interface cppclassanalyzer.data.ClassTypeInfoManager
INVALID_KEY
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
-
Method Summary
Modifier and Type Method Description void
addListener(DomainObjectListener listener)
void
close()
void
executeCommand(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 namesIcon
getIcon(boolean expanded)
Gets the icon for this manager to be used in theTypeInfoArchiveGTree
Collection<LibraryClassTypeInfoManager>
getLibraries()
Gets a collection of libraries contained within this project managerLibraryClassTypeInfoManager
getLibrary(String name)
Gets the library in this project with the specified nameClassTypeInfoManagerPlugin
getPlugin()
<T extends ArchivedRttiData>
TgetRttiData(Class<T> clazz, String symbolName)
TypeInfoTreeNodeManager
getTreeNodeManager()
Gets theTypeInfoTreeNodeManager
for this ClassTypeInfoManagerClassTypeInfoDB
getType(long key)
Gets the ClassTypeInfo for the corresponding database keyClassTypeInfoDB
getType(Function fun)
Gets the ClassTypeInfo for the correspondingFunction
ClassTypeInfoDB
getType(GhidraClass gc)
Gets the ClassTypeInfo for the correspondingGhidraClass
ClassTypeInfoDB
getType(String symbolName)
Gets the ClassTypeInfo with the specified symbol.ClassTypeInfoDB
getType(String name, Namespace namespace)
Gets the ClassTypeInfo with the specified name andNamespace
int
getTypeCount()
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 void
init(ProjectArchive archive)
Initialize theProjectArchive
as a ClassTypeInfoManagervoid
insert(ClassTypeInfoManager manager, TaskMonitor monitor)
Inserts a ClassTypeInfoManager into this projectvoid
insert(Collection<? extends ClassTypeInfoManager> managers, TaskMonitor monitor)
Inserts the collection of managers into this projectboolean
isModifiable()
Checks if the manager can be changedstatic ProjectClassTypeInfoManager
open(ClassTypeInfoManagerService service, ProjectArchive archive)
static FileArchiveClassTypeInfoManager
openIfManagerArchive(ClassTypeInfoManagerPlugin plugin, Archive archive)
Opens the Archive iff it contains a ProjectClassTypeInfoManagervoid
removeListener(DomainObjectListener listener)
ClassTypeInfoDB
resolve(ClassTypeInfo type)
Returns a ClassTypeInfo that is managed by this ClassTypeInfoManager.void
save()
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, startTransaction
Methods 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, updateSourceArchiveName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cppclassanalyzer.data.ClassTypeInfoManager
getName
Methods 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, updateSourceArchiveName
Methods inherited from interface db.util.ErrorHandler
dbError
Methods inherited from interface cppclassanalyzer.data.manager.FileArchiveClassTypeInfoManager
isChanged
Methods 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:ClassTypeInfoManager
Returns a ClassTypeInfo that is managed by this ClassTypeInfoManager. If one does not currently exist a new one is created.- Specified by:
resolve
in interfaceClassTypeInfoManager
- Parameters:
type
- the type to resolve- Returns:
- the equivalent type managed by this ClassTypeInfoManager
-
getType
Description copied from interface:ClassTypeInfoManager
Gets the ClassTypeInfo for the correspondingGhidraClass
- Specified by:
getType
in 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:ClassTypeInfoManager
Gets the ClassTypeInfo for the correspondingFunction
- Specified by:
getType
in 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:ClassTypeInfoManager
Gets the ClassTypeInfo with the specified name andNamespace
- Specified by:
getType
in 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:ClassTypeInfoManager
Gets the ClassTypeInfo with the specified symbol. The supplied symbol should be mangled.- Specified by:
getType
in 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:ClassTypeInfoManager
Gets an iterable over all the managed ClassTypeInfos- Specified by:
getTypes
in interfaceClassTypeInfoManager
- Returns:
- an iterable over all the managed ClassTypeInfos
-
getTypeStream
Description copied from interface:ClassTypeInfoManager
Gets a stream of all the managed ClassTypeInfos- Specified by:
getTypeStream
in interfaceClassTypeInfoManager
- Returns:
- a stream of all the managed ClassTypeInfos
-
getTypeCount
public int getTypeCount()Description copied from interface:ClassTypeInfoManager
Gets the number of managed ClassTypeInfos- Specified by:
getTypeCount
in interfaceClassTypeInfoManager
- Returns:
- the number of managed ClassTypeInfos
-
getPlugin
- Specified by:
getPlugin
in interfaceFileArchiveClassTypeInfoManager
-
getIcon
Description copied from interface:ClassTypeInfoManager
Gets the icon for this manager to be used in theTypeInfoArchiveGTree
- Specified by:
getIcon
in 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:FileArchiveClassTypeInfoManager
Checks if the manager can be changed- Specified by:
isModifiable
in interfaceFileArchiveClassTypeInfoManager
- Returns:
- true if the manager can be changed
-
save
public void save()Description copied from interface:FileArchiveClassTypeInfoManager
Saves all changed data- Specified by:
save
in 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:ClassTypeInfoManager
Gets theTypeInfoTreeNodeManager
for this ClassTypeInfoManager- Specified by:
getTreeNodeManager
in interfaceClassTypeInfoManager
- Returns:
- this manager's TypeInfoTreeNodeManager
-
getType
Description copied from interface:ClassTypeInfoManager
Gets the ClassTypeInfo for the corresponding database key- Specified by:
getType
in interfaceClassTypeInfoManager
- Parameters:
key
- the database key- Returns:
- the ClassTypeInfo or null if it doesn't exist
-
addListener
- Specified by:
addListener
in interfaceClassTypeInfoManager
-
removeListener
- Specified by:
removeListener
in 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:
close
in interfaceDataTypeManager
- Overrides:
close
in classProjectDataTypeManager
-
init
Initialize theProjectArchive
as 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)
-