DocumentWriter.DocumentWriter Class Reference


Detailed Description

DocumentWriter is a class for writing the contents of a document into a given file.

Derive a sub-class for each combination of file format and set of features (typically represented by a particular type of document). The only method that requires overriding is the initialize(). See the method comments for initialize() for more details.

Pass document pointer here to make sure the subclass can use the pointer to get document version, cut etc. to set the target.

#include <class_document_writer_1_1_document_writer.h>

Inheritance diagram for DocumentWriter.DocumentWriter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  __init__ ()
  getFilename ()
  Returns the filename corresponding to the file to be written.
  getDocument ()
  Returns the document corresponding to the fiel to be wirtten.
  initialize ()
  Override this in any derived class.
  writeSource ()
  write ()
  Writes the document contents, for the features that have registered writers, into the given file.
  getTarget ()
  Returns the target to which the data will be written.
  setTarget ()
  Sets the target to which the data will be written.
  getFeatureWriter ()
  Given a feature id, returns the registered writer for the corresponding feature; None if no writers was registered.
  register ()
  Registers the given FeatureWriter class for the feature identified by the given id.
  setSearchPaths ()
  Given a feature id, sets the search paths to be used by its corresponding FeatureWriter.

Member Function Documentation

DocumentWriter.DocumentWriter.__init__ ( )
DocumentWriter.DocumentWriter.getFilename ( )

Returns the filename corresponding to the file to be written.

DocumentWriter.DocumentWriter.getDocument ( )

Returns the document corresponding to the fiel to be wirtten.

DocumentWriter.DocumentWriter.initialize ( )

Override this in any derived class.

Tasks that should be performed here include:

  • setting the target, using setTarget(), if necessary
  • registering a feature writer for each of the features that this document writer is responsible for.

At the end of the derived initialize() implementation, this base class method must be called.

Reimplemented in XMLDocumentWriter.XMLDocumentWriter.

DocumentWriter.DocumentWriter.writeSource ( )
DocumentWriter.DocumentWriter.write ( )

Writes the document contents, for the features that have registered writers, into the given file.

DocumentWriter.DocumentWriter.getTarget ( )

Returns the target to which the data will be written.

DocumentWriter.DocumentWriter.setTarget ( )

Sets the target to which the data will be written.

Classes derived from this one should call this method with the type of target best suited for writing the given document.

DocumentWriter.DocumentWriter.getFeatureWriter ( )

Given a feature id, returns the registered writer for the corresponding feature; None if no writers was registered.

DocumentWriter.DocumentWriter.register ( )

Registers the given FeatureWriter class for the feature identified by the given id.

DocumentWriter.DocumentWriter.setSearchPaths ( )

Given a feature id, sets the search paths to be used by its corresponding FeatureWriter.

Returns True if set successfully; False otherwise.


DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter
DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter DocumentWriter.DocumentWriter