summaryrefslogtreecommitdiff
path: root/tools/gnu/classpath/tools/javah/CniIncludePrinter.java
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gnu/classpath/tools/javah/CniIncludePrinter.java')
-rw-r--r--tools/gnu/classpath/tools/javah/CniIncludePrinter.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/tools/gnu/classpath/tools/javah/CniIncludePrinter.java b/tools/gnu/classpath/tools/javah/CniIncludePrinter.java
index 6561169bb..fb007b131 100644
--- a/tools/gnu/classpath/tools/javah/CniIncludePrinter.java
+++ b/tools/gnu/classpath/tools/javah/CniIncludePrinter.java
@@ -46,24 +46,35 @@ import java.io.PrintStream;
public class CniIncludePrinter
extends Printer
{
+ protected CniIncludePrinter(Main classpath, File outFile, boolean isDir,
+ boolean force)
+ {
+ super(classpath, outFile, isDir, force);
+ }
- protected CniIncludePrinter(Main classpath)
+ protected void writePreambleImpl(PrintStream ps)
{
- super(classpath);
+ // does nothing
}
- public void printClass(File outputDir, ClassWrapper klass) throws IOException
+ protected PrintStream getPrintStreamImpl(FileOutputStream fos,
+ ClassWrapper klass)
+ {
+ return new PrintStream(fos);
+ }
+
+ public void printClass(ClassWrapper klass) throws IOException
{
// Never write Object or Class. This is a hack, maybe
// the user would like to see what they look like...
if (klass.name.equals("java/lang/Object")
|| klass.name.equals("java/lang/Class"))
return;
- File klassFile = new File(outputDir, klass.name + ".h");
- klassFile.getParentFile().mkdirs();
- PrintStream ps = new PrintStream(new FileOutputStream(klassFile));
+ PrintStream ps = getPrintStream(klass.name + ".h", klass);
+ if (ps == null)
+ return;
+ ps.println();
klass.printFully(ps);
ps.close();
}
-
}