Package com.jogamp.gluegen
Class CodeUnit
- java.lang.Object
-
- com.jogamp.gluegen.CodeUnit
-
- Direct Known Subclasses:
CCodeUnit,JavaCodeUnit
public class CodeUnit extends Object
General code unit (a generated C or Java source file), covering multipleFunctionEmitterallowing to unify output, decoration and dynamic helper code injection per unit.
-
-
Field Summary
Fields Modifier and Type Field Description StringfilenamePrintWriteroutput
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddTailCode(String c)Add a tail code to this unitvoidclose()voidemit(String s)voidemitf(String s, Object... args)voidemitln()voidemitln(String s)voidemitTailCode()StringtoString()
-
-
-
Field Detail
-
filename
public final String filename
-
output
public final PrintWriter output
-
-
Constructor Detail
-
CodeUnit
protected CodeUnit(String filename, Object generator) throws IOException
- Parameters:
filename- the class's full filename to open w/ write accessgenerator- informal optional object that is creating this unit, used to be mentioned in a warning message if not null.- Throws:
IOException
-
-
Method Detail
-
addTailCode
public boolean addTailCode(String c)
Add a tail code to this unit- Parameters:
c- the code to be added to the tail of this code unit- Returns:
- true if the `tailCode` set did not already contain the specified code `c`
-
emitln
public void emitln()
-
emitln
public void emitln(String s)
-
emit
public void emit(String s)
-
emitTailCode
public void emitTailCode()
-
close
public void close()
-
-