diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-10-05 02:44:18 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-10-05 02:44:18 +0000 |
commit | 2799793789d5b66c90efbd1a3eb56e0c1ec57f88 (patch) | |
tree | 9157197f502b6830af9cafe029fd3d47628a7ed6 /tools/gnu/classpath/tools/javah/CniIncludePrinter.java | |
parent | 7516107c5abe26f7a4378017344eb9e449ebc28e (diff) | |
download | classpath-2799793789d5b66c90efbd1a3eb56e0c1ec57f88.tar.gz |
2006-10-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of HEAD-->generics for 2006/09/03-2006/10/04.
Diffstat (limited to 'tools/gnu/classpath/tools/javah/CniIncludePrinter.java')
-rw-r--r-- | tools/gnu/classpath/tools/javah/CniIncludePrinter.java | 25 |
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(); } - } |