Class MultiByteCharMatcher

java.lang.Object
ghidra.util.ascii.MultiByteCharMatcher
All Implemented Interfaces:
ByteStreamCharMatcher

public class MultiByteCharMatcher extends Object implements ByteStreamCharMatcher
  • Constructor Summary

    Constructors
    Constructor
    Description
    MultiByteCharMatcher(int minLength, CharSetRecognizer charSet, CharWidth charWidth, Endian endian, int alignment, int offset)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(byte b)
    Adds the next contiguous byte to this matcher
    boolean
    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
    Resets the internal state of this ByteMatcher so that it can be reused against another byte stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface ByteStreamCharMatcher
      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 interface ByteStreamCharMatcher
      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 interface ByteStreamCharMatcher
      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 interface ByteStreamCharMatcher