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 multipleFunctionEmitter
allowing to unify output, decoration and dynamic helper code injection per unit.
-
-
Field Summary
Fields Modifier and Type Field Description String
filename
PrintWriter
output
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addTailCode(String c)
Add a tail code to this unitvoid
close()
void
emit(String s)
void
emitf(String s, Object... args)
void
emitln()
void
emitln(String s)
void
emitTailCode()
String
toString()
-
-
-
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()
-
-