de.dokutransdata.antlatex
Class Grep1

java.lang.Object
  extended by de.dokutransdata.antlatex.Grep1

public class Grep1
extends java.lang.Object

A grep-like program. No options, but takes a pattern and an arbitrary list of text files.


Field Summary
protected  java.util.regex.Matcher matcher
          The matcher for this pattern
protected  java.util.regex.Pattern pattern
          The pattern we're looking for
static java.lang.String RCS_ID
           
 
Constructor Summary
Grep1(java.lang.String patt)
          Construct a Grep1 program
 
Method Summary
static int doit(java.lang.String[] argv, boolean verbose)
          Main will make a Grep object for the pattern, and run it on all input files listed in argv.
 boolean getVerbose()
           
 int process(java.io.BufferedReader inputFile, java.lang.String fileName, boolean printFileName)
          Do the work of scanning one file
 void setVerbose(boolean verbose)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

pattern

protected java.util.regex.Pattern pattern
The pattern we're looking for


matcher

protected java.util.regex.Matcher matcher
The matcher for this pattern

Constructor Detail

Grep1

public Grep1(java.lang.String patt)
Construct a Grep1 program

Method Detail

doit

public static int doit(java.lang.String[] argv,
                       boolean verbose)
                throws java.lang.Exception
Main will make a Grep object for the pattern, and run it on all input files listed in argv.

Throws:
java.lang.Exception

process

public int process(java.io.BufferedReader inputFile,
                   java.lang.String fileName,
                   boolean printFileName)
Do the work of scanning one file

Parameters:
inputFile - BufferedReader object already open
fileName - String Name of the input file
printFileName - Boolean - true to print filename before lines that match.
Returns:
1 if pattern was found

getVerbose

public boolean getVerbose()

setVerbose

public final void setVerbose(boolean verbose)
Parameters:
verbose - The verbose to set.