Package ghidra.util.ascii
Class MultiByteCharMatcher
- java.lang.Object
-
- ghidra.util.ascii.MultiByteCharMatcher
-
- All Implemented Interfaces:
ByteStreamCharMatcher
public class MultiByteCharMatcher extends java.lang.Object implements ByteStreamCharMatcher
-
-
Constructor Summary
Constructors Constructor Description MultiByteCharMatcher(int minLength, CharSetRecognizer charSet, CharWidth charWidth, Endian endian, int alignment, int offset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(byte b)
Adds the next contiguous byte to this matcherboolean
endSequence()
Tells the matcher that there are no more contiguous bytes.Sequence
getSequence()
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 Detail
-
MultiByteCharMatcher
public MultiByteCharMatcher(int minLength, CharSetRecognizer charSet, CharWidth charWidth, Endian endian, int alignment, int offset)
-
-
Method Detail
-
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
public 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
-
-