Package ghidra.program.util
Class ProgramDiffFilter
java.lang.Object
ghidra.program.util.ProgramDiffFilter
The
Valid filter types are: BYTE_DIFFS, CODE_UNIT_DIFFS, PLATE_COMMENT_DIFFS, PRE_COMMENT_DIFFS, EOL_COMMENT_DIFFS, REPEATABLE_COMMENT_DIFFS, POST_COMMENT_DIFFS, REFERENCE_DIFFS, USER_DEFINED_DIFFS, BOOKMARK_DIFFS, SYMBOL_DIFFS, EQUATE_DIFFS, FUNCTION_DIFFS, PROGRAM_CONTEXT_DIFFS.
Predefined filter type combinations are: COMMENT_DIFFS and ALL_DIFFS.
ProgramDiffFilter
is used when determining or working with
differences between two programs.
It indicates the types of program differences we are interested in.
Each difference type can be set to true, indicating interest in
differences of that type between two programs. False indicates no interest
in this type of program difference.
Valid filter types are: BYTE_DIFFS, CODE_UNIT_DIFFS, PLATE_COMMENT_DIFFS, PRE_COMMENT_DIFFS, EOL_COMMENT_DIFFS, REPEATABLE_COMMENT_DIFFS, POST_COMMENT_DIFFS, REFERENCE_DIFFS, USER_DEFINED_DIFFS, BOOKMARK_DIFFS, SYMBOL_DIFFS, EQUATE_DIFFS, FUNCTION_DIFFS, PROGRAM_CONTEXT_DIFFS.
Predefined filter type combinations are: COMMENT_DIFFS and ALL_DIFFS.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Indicates all filters for all defined types of differences.static final int
Indicates the filter for bookmark differences.static final int
Indicates the filter for the byte differences.static final int
Indicates the filter for the code unit differences.static final int
Indicates all comment filters.static final int
Indicates the filter for the end of line comment differences.static final int
Indicates the filter for the equates differences.static final int
Indicates the filter for the function differences.static final int
Indicates the filter for the function tag differences.static final int
Indicates the filter for the plate comment differences.static final int
Indicates the filter for the post comment differences.static final int
Indicates the filter for the pre comment differences.static final int
Indicates the filter for the program context (register) differences.static final int
Indicates the filter for memory, variable, and external reference differences.static final int
Indicates the filter for the repeatable comment differences.static final int
Indicates the filter for the symbol differences.static final int
Indicates the filter for the user defined property differences. -
Constructor Summary
ConstructorDescriptionCreates new ProgramDiffFilter with none of the diff types selected.ProgramDiffFilter
(int type) Creates new ProgramDiffFilter with the specified diff types selected.ProgramDiffFilter
(ProgramDiffFilter filter) Creates new ProgramDiffFilter equivalent to the specified ProgramDiffFilter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToFilter
(ProgramDiffFilter filter) set this filter to look for types of differences in addition to those types where it is already looking for differences.void
clearAll()
Sets all the defined types of differences to false.boolean
Determines whether or not this filter is equal to the object that is passed in.boolean
getFilter
(int type) getFilter determines whether or not the specified type of filter is set.static int[]
Gets all the valid individual types of differences for this filter.void
Sets all the defined types of differences to true.void
setFilter
(int type, boolean filter) setFilter specifies whether or not the indicated type of difference will be included by the filter (true) or not included (false).toString()
Returns a string representation of the current settings for this filter.static String
typeToName
(int type) typeToName()
returns the name of the difference type.
-
Field Details
-
PROGRAM_CONTEXT_DIFFS
public static final int PROGRAM_CONTEXT_DIFFSIndicates the filter for the program context (register) differences.- See Also:
-
BYTE_DIFFS
public static final int BYTE_DIFFSIndicates the filter for the byte differences.- See Also:
-
CODE_UNIT_DIFFS
public static final int CODE_UNIT_DIFFSIndicates the filter for the code unit differences.- See Also:
-
EOL_COMMENT_DIFFS
public static final int EOL_COMMENT_DIFFSIndicates the filter for the end of line comment differences.- See Also:
-
PRE_COMMENT_DIFFS
public static final int PRE_COMMENT_DIFFSIndicates the filter for the pre comment differences.- See Also:
-
POST_COMMENT_DIFFS
public static final int POST_COMMENT_DIFFSIndicates the filter for the post comment differences.- See Also:
-
PLATE_COMMENT_DIFFS
public static final int PLATE_COMMENT_DIFFSIndicates the filter for the plate comment differences.- See Also:
-
REPEATABLE_COMMENT_DIFFS
public static final int REPEATABLE_COMMENT_DIFFSIndicates the filter for the repeatable comment differences.- See Also:
-
REFERENCE_DIFFS
public static final int REFERENCE_DIFFSIndicates the filter for memory, variable, and external reference differences.- See Also:
-
EQUATE_DIFFS
public static final int EQUATE_DIFFSIndicates the filter for the equates differences.- See Also:
-
SYMBOL_DIFFS
public static final int SYMBOL_DIFFSIndicates the filter for the symbol differences.- See Also:
-
FUNCTION_DIFFS
public static final int FUNCTION_DIFFSIndicates the filter for the function differences.- See Also:
-
BOOKMARK_DIFFS
public static final int BOOKMARK_DIFFSIndicates the filter for bookmark differences.- See Also:
-
USER_DEFINED_DIFFS
public static final int USER_DEFINED_DIFFSIndicates the filter for the user defined property differences.- See Also:
-
FUNCTION_TAG_DIFFS
public static final int FUNCTION_TAG_DIFFSIndicates the filter for the function tag differences.- See Also:
-
COMMENT_DIFFS
public static final int COMMENT_DIFFSIndicates all comment filters.- See Also:
-
ALL_DIFFS
public static final int ALL_DIFFSIndicates all filters for all defined types of differences.- See Also:
-
-
Constructor Details
-
ProgramDiffFilter
public ProgramDiffFilter()Creates new ProgramDiffFilter with none of the diff types selected. -
ProgramDiffFilter
Creates new ProgramDiffFilter equivalent to the specified ProgramDiffFilter.- Parameters:
filter
- the diff filter this one should equal.
-
ProgramDiffFilter
public ProgramDiffFilter(int type) Creates new ProgramDiffFilter with the specified diff types selected.- Parameters:
type
- one or more of the diff types "OR"ed together.
i.e. CODE_UNIT_DIFFS | SYMBOL_DIFFS
-
-
Method Details
-
getFilter
public boolean getFilter(int type) getFilter determines whether or not the specified type of filter is set.- Parameters:
type
- the set bits indicate the type of differences we want to check as being set in the filter.
For example, one or more of the diff types "OR"ed together.
i.e. CODE_UNIT_DIFFS | SYMBOL_DIFFS- Returns:
- true if filtering for the specified type of differences.
-
addToFilter
set this filter to look for types of differences in addition to those types where it is already looking for differences. The filter that is passed as a parameter indicates the additional types of differences.- Parameters:
filter
- filter indicating the additional types of differences to look for between the programs.
-
setFilter
public void setFilter(int type, boolean filter) setFilter specifies whether or not the indicated type of difference will be included by the filter (true) or not included (false).- Parameters:
type
- the set bits indicate the type of differences we want to look for in the programs.
For example, one or more of the diff types "OR"ed together.
i.e. CODE_UNIT_DIFFS | SYMBOL_DIFFSfilter
- true if you want to determine differences of the specified type.
-
clearAll
public void clearAll()Sets all the defined types of differences to false. Filter indicates no interest in any difference types. -
selectAll
public void selectAll()Sets all the defined types of differences to true. Filter indicates interest in all difference types. -
getPrimaryTypes
public static int[] getPrimaryTypes()Gets all the valid individual types of differences for this filter. These are also referred to as primary difference types.- Returns:
- an array containing all the currently defined difference types
-
typeToName
typeToName()
returns the name of the difference type. Only predefined types, as specified inProgramDiffFilter
, will return a name. Otherwise, an empty string is returned.- Parameters:
type
- the type of difference whose name is wanted.- Returns:
- the name of the predefined difference type. Otherwise, the empty string.
-
equals
Determines whether or not this filter is equal to the object that is passed in. -
toString
Returns a string representation of the current settings for this filter.
-