comparison src/docgen/graphutils/writers.d @ 806:bcb74c9b895c

Moved out files in the trunk folder to the root.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sun, 09 Mar 2008 00:12:19 +0100
parents trunk/src/docgen/graphutils/writers.d@db7e27b5c180
children
comparison
equal deleted inserted replaced
805:a3fab8b74a7d 806:bcb74c9b895c
1 /**
2 * Author: Jari-Matti Mäkelä
3 * License: GPL3
4 */
5 module docgen.graphutils.writers;
6
7 public import docgen.graphutils.writer;
8 import docgen.graphutils.dotwriter;
9 import docgen.graphutils.modulepathwriter;
10 import docgen.graphutils.modulenamewriter;
11
12 class DefaultGraphWriterFactory : AbstractWriterFactory, GraphWriterFactory {
13 public:
14
15 this(DocGenerator generator) {
16 super(generator);
17 }
18
19 GraphWriter createGraphWriter(PageWriter writer, GraphFormat outputFormat) {
20 switch (outputFormat) {
21 case GraphFormat.Dot:
22 return new DotWriter(this, writer);
23 case GraphFormat.ModuleNames:
24 return new ModuleNameWriter(this, writer);
25 case GraphFormat.ModulePaths:
26 return new ModulePathWriter(this, writer);
27 default:
28 throw new Exception("Graph writer type does not exist!");
29 }
30 }
31 }
32
33 class DefaultCachingGraphWriterFactory : AbstractWriterFactory, CachingGraphWriterFactory {
34 public:
35
36 CachingDocGenerator generator;
37
38 this(CachingDocGenerator generator) {
39 super(generator);
40 this.generator = generator;
41 }
42
43 GraphCache graphCache() {
44 return generator.graphCache;
45 }
46
47 override GraphWriter createGraphWriter(PageWriter writer, GraphFormat outputFormat) {
48 switch (outputFormat) {
49 case GraphFormat.Dot:
50 return new CachingDotWriter(this, writer);
51 case GraphFormat.ModuleNames:
52 return new ModuleNameWriter(this, writer);
53 case GraphFormat.ModulePaths:
54 return new ModulePathWriter(this, writer);
55 default:
56 throw new Exception("Graph writer type does not exist!");
57 }
58 }
59 }