view trunk/src/docgen/sourcelisting/latexwriter.d @ 717:cb8edb09108a

Updated docgen (mostly) to new tango. Reflective options. Updated translations.
author Jari-Matti M?kel? <jmjm@iki.fi>
date Fri, 01 Feb 2008 15:05:56 +0200
parents 33a4cb255fcc
children
line wrap: on
line source

/**
 * Author: Jari-Matti Mäkelä
 * License: GPL3
 */
module docgen.sourcelisting.latexwriter;

import docgen.sourcelisting.writer;
//import dil.Parser;
import tango.io.FilePath;

/**
 * Adds a code listing section for the given file. 
 */
class LaTeXWriter : AbstractWriter!(ListingWriterFactory), ListingWriter {
  PageWriter writer;
  
  this(ListingWriterFactory factory, PageWriter writer) {
    super(factory);
    this.writer = writer;
  }

  //void generateListing(Parser parser) { /* TODO */ }
  
  void generateListing(InputStream input, OutputStream output, char[] moduleName) {
    output.copy(input);
    
    writer.addListing(
      moduleName,
      FilePath((cast(Object)output.conduit).toString()).file
    );
  }
}