view trunk/src/docgen/graphutils/modulepathwriter.d @ 453:4e5b35df3060

Parsing bugfixes, cleaned up imports.
author Jari-Matti M?kel? <jmjm@iki.fi>
date Thu, 25 Oct 2007 01:08:38 +0300
parents 3f44c38bf870
children dbdc9fa5d479
line wrap: on
line source

/**
 * Author: Aziz Köksal & Jari-Matti Mäkelä
 * License: GPL3
 */
module docgen.graphutils.modulepathwriter;
import docgen.graphutils.writer;

import tango.io.Print: Print;
import tango.text.convert.Layout : Layout;

class ModulePathWriter : AbstractGraphWriter {
  this(GraphWriterFactory factory, DocumentWriter writer) {
    super(factory, writer);
  }

  void generateGraph(Vertex[] vertices, Edge[] edges, OutputStream imageFile) {

    void doPaths(Vertex[] v, uint level, char[] indent = "") {
      if (!level) return;

      foreach (vertex; v) {
        // TODO: output(indent)(vertex.location).newline;
        if (vertex.outgoing.length)
          doPaths(vertex.outgoing, level-1, indent ~ "  ");
      }
    }

    doPaths(vertices, factory.options.graph.depth);
  }
}