Package com.jogamp.gluegen.jcpp
Class CppReader
- java.lang.Object
-
- java.io.Reader
-
- com.jogamp.gluegen.jcpp.CppReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
public class CppReader extends Reader implements Closeable
A Reader wrapper around the Preprocessor. This is a utility class to provide a transparentReader
which preprocesses the input text.- See Also:
Preprocessor
,Reader
-
-
Constructor Summary
Constructors Constructor Description CppReader(Preprocessor p)
CppReader(Reader r)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMacro(String name)
Defines the given name as a macro.void
addMacro(String name, String value)
Defines the given name as a macro.void
close()
Preprocessor
getPreprocessor()
Returns the Preprocessor used by this CppReader.int
read()
int
read(char[] cbuf, int off, int len)
-
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, ready, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
CppReader
public CppReader(@Nonnull Reader r)
-
CppReader
public CppReader(@Nonnull Preprocessor p)
-
-
Method Detail
-
getPreprocessor
@Nonnull public Preprocessor getPreprocessor()
Returns the Preprocessor used by this CppReader.
-
addMacro
public void addMacro(@Nonnull String name) throws LexerException
Defines the given name as a macro. This is a convnience method.- Throws:
LexerException
-
addMacro
public void addMacro(@Nonnull String name, @Nonnull String value) throws LexerException
Defines the given name as a macro. This is a convnience method.- Throws:
LexerException
-
read
public int read() throws IOException
- Overrides:
read
in classReader
- Throws:
IOException
-
read
public int read(char[] cbuf, int off, int len) throws IOException
- Specified by:
read
in classReader
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
-