annotate trunk/src/docgen/sourcelisting/writers.d @ 449:757bd048482c

Depgraph test + minor modifications.
author Jari-Matti M?kel? <jmjm@iki.fi>
date Wed, 17 Oct 2007 20:35:56 +0300
parents 49f3afd6a0e8
children 3f44c38bf870
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
395
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
1 /**
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
2 * Author: Jari-Matti Mäkelä
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
3 * License: GPL3
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
4 */
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
5 module docgen.sourcelisting.writers;
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
6
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
7 public import docgen.sourcelisting.writer;
444
0bda71dc9c4f More document template and source listing code.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 395
diff changeset
8 import docgen.sourcelisting.latexwriter;
0bda71dc9c4f More document template and source listing code.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 395
diff changeset
9 import docgen.sourcelisting.htmlwriter;
0bda71dc9c4f More document template and source listing code.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 395
diff changeset
10 import docgen.sourcelisting.xmlwriter;
0bda71dc9c4f More document template and source listing code.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 395
diff changeset
11 import docgen.sourcelisting.plaintextwriter;
395
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
12
446
49f3afd6a0e8 Refactored writers.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 444
diff changeset
13 class DefaultListingWriterFactory : AbstractWriterFactory, ListingWriterFactory {
49f3afd6a0e8 Refactored writers.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 444
diff changeset
14 this(DocGenerator generator) {
49f3afd6a0e8 Refactored writers.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 444
diff changeset
15 super(generator);
395
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
16 }
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
17
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
18 ListingWriter createListingWriter(OutputStream[] outputs) {
449
757bd048482c Depgraph test + minor modifications.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 446
diff changeset
19 switch (options.docFormat) {
395
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
20 case DocFormat.LaTeX:
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
21 return new LaTeXWriter(this, outputs);
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
22 case DocFormat.XML:
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
23 return new XMLWriter(this, outputs);
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
24 case DocFormat.HTML:
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
25 return new HTMLWriter(this, outputs);
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
26 case DocFormat.PlainText:
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
27 return new PlainTextWriter(this, outputs);
444
0bda71dc9c4f More document template and source listing code.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 395
diff changeset
28 default:
0bda71dc9c4f More document template and source listing code.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 395
diff changeset
29 throw new Exception("Listing writer type does not exist!");
395
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
30 }
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
31 }
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
32 }