Package ghidra.features.base.replace
Class SearchAndReplaceHandler
java.lang.Object
ghidra.features.base.replace.SearchAndReplaceHandler
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
DatatypeCategorySearchAndReplaceHandler
,DataTypesSearchAndReplaceHandler
,ListingCommentsSearchAndReplaceHandler
,MemoryBlockSearchAndReplaceHandler
,ProgramTreeSearchAndReplaceHandler
,SymbolsSearchAndReplaceHandler
Base class for discoverable SearchAndReplaceHandlers. A SearchAndReplaceHandler is responsible
for searching one or more specific program elements (referred to as
SearchType
) for a
given search pattern and generating the appropriate QuickFix
.
Typically, one handler will handle related search elements for efficiency. For example, the DataTypesSearchAndReplaceHandler is responsible for datatype names, field names, field comments, etc. The idea is to only loop through all the datatypes once, regardless of what aspect of a datatype you are searching for.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addType
(SearchType type) abstract void
findAll
(Program program, SearchAndReplaceQuery query, Accumulator<QuickFix> accumulator, TaskMonitor monitor) Method to perform the search for the pattern and options as specified by the given SearchAndReplaceQuery.Returns the set ofSearchType
s this handler supports.
-
Constructor Details
-
SearchAndReplaceHandler
public SearchAndReplaceHandler()
-
-
Method Details
-
findAll
public abstract void findAll(Program program, SearchAndReplaceQuery query, Accumulator<QuickFix> accumulator, TaskMonitor monitor) throws CancelledException Method to perform the search for the pattern and options as specified by the given SearchAndReplaceQuery. As matches are found, appropriateQuickFix
s are added to the given accumulator.- Parameters:
program
- the program being searchedquery
- contains the search pattern, replacement pattern, and options related to the query.accumulator
- the accumulator that resulting QuickFix items are added to as they are found.monitor
- aTaskMonitor
for reporting progress and checking if the search has been cancelled.- Throws:
CancelledException
- thrown if the operation has been cancelled via the taskmonitor
-
getSearchAndReplaceTypes
Returns the set ofSearchType
s this handler supports.- Returns:
- the set of
SearchType
s this handler supports.
-
addType
-