annotate trunk/src/docgen/graphutils/writers.d @ 446:49f3afd6a0e8

Refactored writers.
author Jari-Matti M?kel? <jmjm@iki.fi>
date Wed, 17 Oct 2007 18:41:46 +0300
parents 0bda71dc9c4f
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.graphutils.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.graphutils.writer;
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
8 import docgen.graphutils.dotwriter;
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
9 import docgen.graphutils.modulepathwriter;
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
10 import docgen.graphutils.modulenamewriter;
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
11
446
49f3afd6a0e8 Refactored writers.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 444
diff changeset
12 class DefaultGraphWriterFactory : AbstractWriterFactory, GraphWriterFactory {
49f3afd6a0e8 Refactored writers.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 444
diff changeset
13 this(DocGenerator generator) {
49f3afd6a0e8 Refactored writers.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 444
diff changeset
14 super(generator);
395
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
15 }
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 GraphWriterDg createGraphWriter(OutputStream[] outputs) {
446
49f3afd6a0e8 Refactored writers.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 444
diff changeset
18 switch (options.graph.graphFormat) {
395
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
19 case GraphFormat.Dot:
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
20 return &((new DotWriter(this, outputs)).generateGraph);
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
21 case GraphFormat.ModuleNames:
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
22 return &((new ModuleNameWriter(this, outputs)).generateGraph);
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
23 case GraphFormat.ModulePaths:
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
24 return &((new ModulePathWriter(this, outputs)).generateGraph);
444
0bda71dc9c4f More document template and source listing code.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 395
diff changeset
25 default:
0bda71dc9c4f More document template and source listing code.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 395
diff changeset
26 throw new Exception("Graph writer type does not exist!");
395
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
27 }
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
28 }
ac9cd48151b6 Added couple of docgen modules.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
29 }