org.eclipse.cdt.internal.ui.text
Class CCodeReader

java.lang.Object
  extended by java.io.Reader
      extended by org.eclipse.cdt.internal.ui.text.SingleCharReader
          extended by org.eclipse.cdt.internal.ui.text.CCodeReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class CCodeReader
extends SingleCharReader

Reads from a document either forwards or backwards. May be configured to skip comments and strings.


Field Summary
static int EOF
          The EOF character
 
Constructor Summary
CCodeReader()
           
 
Method Summary
 void close()
           
 void configureBackwardReader(org.eclipse.jface.text.IDocument document, int offset, boolean skipComments, boolean skipStrings)
           
 void configureForwardReader(org.eclipse.jface.text.IDocument document, int offset, int length, boolean skipComments, boolean skipStrings)
           
 int getOffset()
          Returns the offset of the last read character.
 int read()
           
 
Methods inherited from class org.eclipse.cdt.internal.ui.text.SingleCharReader
getString, read, ready
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOF

public static final int EOF
The EOF character

See Also:
Constant Field Values
Constructor Detail

CCodeReader

public CCodeReader()
Method Detail

getOffset

public int getOffset()
Returns the offset of the last read character. Should only be called after read has been called.


configureForwardReader

public void configureForwardReader(org.eclipse.jface.text.IDocument document,
                                   int offset,
                                   int length,
                                   boolean skipComments,
                                   boolean skipStrings)
                            throws java.io.IOException
Throws:
java.io.IOException

configureBackwardReader

public void configureBackwardReader(org.eclipse.jface.text.IDocument document,
                                    int offset,
                                    boolean skipComments,
                                    boolean skipStrings)
                             throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Reader
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Specified by:
read in class SingleCharReader
Throws:
java.io.IOException
See Also:
Reader.read()