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>
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. |
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:
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.