Bug 563485 - Add StringMatcher.usePrefixMatch()

Add a method to make the StringMatcher match on prefixes. Internally
this just switches on wildcard matching and sets fHasTrailingStar to
true. Because the pattern has already been parsed in the constructor,
this gives an easy way to specify prefix matching for non-wildcard
patterns without needing to escape potential wildcards in the pattern:

  StringMatcher m = new StringMatcher("foo*bar", false, true);
  m.usePrefixMatch();

This matcher will match any text starting with "foo*bar" (with a
literal '*'), but not, for instance, "foobazbar".

Change-Id: I525fbc1d42b16d661988655c8438894f8d6739e8
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 files changed