Package ghidra.util.ascii
Class MultiByteCharMatcher
java.lang.Object
ghidra.util.ascii.MultiByteCharMatcher
- All Implemented Interfaces:
ByteStreamCharMatcher
-
Constructor Summary
ConstructorDescriptionMultiByteCharMatcher
(int minLength, CharSetRecognizer charSet, CharWidth charWidth, Endian endian, int alignment, int offset) -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(byte b) Adds the next contiguous byte to this matcherboolean
Tells the matcher that there are no more contiguous bytes.Returns the currently recognized sequence which only exists immediately after an add or end sequence is called with a return value of true.void
reset()
Resets the internal state of this ByteMatcher so that it can be reused against another byte stream.
-
Constructor Details
-
MultiByteCharMatcher
public MultiByteCharMatcher(int minLength, CharSetRecognizer charSet, CharWidth charWidth, Endian endian, int alignment, int offset)
-
-
Method Details
-
add
public boolean add(byte b) Description copied from interface:ByteStreamCharMatcher
Adds the next contiguous byte to this matcher- Specified by:
add
in interfaceByteStreamCharMatcher
- Parameters:
b
- the next contiguous byte in the search stream.- Returns:
- true if the given byte triggered a sequence match. Note that this byte may not be a part of the recognized sequence.
-
getSequence
Description copied from interface:ByteStreamCharMatcher
Returns the currently recognized sequence which only exists immediately after an add or end sequence is called with a return value of true.- Specified by:
getSequence
in interfaceByteStreamCharMatcher
- Returns:
-
endSequence
public boolean endSequence()Description copied from interface:ByteStreamCharMatcher
Tells the matcher that there are no more contiguous bytes. If the current state of the matcher is such that there is a valid sequence that can be at the end of the stream, then a sequence will be created and true will be returned.- Specified by:
endSequence
in interfaceByteStreamCharMatcher
- Returns:
- true if there is a valid sequence at the end of the stream.
-
reset
public void reset()Description copied from interface:ByteStreamCharMatcher
Resets the internal state of this ByteMatcher so that it can be reused against another byte stream.- Specified by:
reset
in interfaceByteStreamCharMatcher
-