Package ghidra.program.database.code
Class StringDiff
java.lang.Object
ghidra.program.database.code.StringDiff
Container object that holds a start and end position within a string. A list of StringDiffs
is used to keep track of changes made to a string.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringDiff
allTextReplaced
(String newText) Construct a new StringDiff with pos1 and pos2 are initialized to -1boolean
int
hashCode()
static StringDiff
static StringDiff
textDeleted
(int start, int end) Construct a new StringDiff that indicates text was deleted from pos1 to pos2static StringDiff
textInserted
(String newText, int start) Construct a new StringDiff that indicates that insertData was inserted at the given positiontoString()
-
Field Details
-
text
String being inserted. This can be an insert or a complete replace (the positions will both be -1 in a replace; pos1 will be non-negative during an insert).
-
-
Method Details
-
allTextReplaced
Construct a new StringDiff with pos1 and pos2 are initialized to -1- Parameters:
newText
- string- Returns:
- the new diff
-
textDeleted
Construct a new StringDiff that indicates text was deleted from pos1 to pos2- Parameters:
start
- position 1 for the diffend
- position 2 for the diff- Returns:
- the new diff
-
textInserted
Construct a new StringDiff that indicates that insertData was inserted at the given position- Parameters:
newText
- inserted stringstart
- position where the text was inserted- Returns:
- the new diff
-
restore
-
hashCode
public int hashCode() -
equals
-
toString
-