nidas  v1.2-1520
Public Member Functions | Private Member Functions | Private Attributes | List of all members
nidas::core::XMLWriter Class Reference

Wrapper class around xerces-c DOMWriter to write XML. More...

#include <XMLWriter.h>

Inheritance diagram for nidas::core::XMLWriter:
Inheritance graph
[legend]

Public Member Functions

 XMLWriter () throw (nidas::core::XMLException)
 Constructor. More...
 
virtual ~XMLWriter ()
 Nuke the XMLWriter. More...
 
void setDiscardDefaultContent (bool val)
 Discard default content. More...
 
void setEntities (bool val)
 Control writing of entities. More...
 
void setCanonicalForm (bool val)
 Canonicalize the output. More...
 
void setPrettyPrint (bool val)
 Format pretty-print. More...
 
void setNormalizeCharacters (bool val)
 Normalize characters. More...
 
void setSplitCDATASections (bool val)
 Split CDATA sections. More...
 
void setValidation (bool val)
 Validation. More...
 
void setWhitespaceInElement (bool val)
 Whitespace in element content. More...
 
void setXMLDeclaration (bool val)
 Include xml declaration. More...
 
void setFilter (xercesc::DOMWriterFilter *filter)
 
virtual void write (xercesc::DOMDocument *doc, const std::string &fileName) throw (nidas::core::XMLException,nidas::util::IOException)
 
virtual void writeNode (xercesc::XMLFormatTarget *const dest, const xercesc::DOMNode &node) throw (nidas::core::XMLException,nidas::util::IOException)
 

Private Member Functions

 XMLWriter (const XMLWriter &)
 No copying. More...
 
XMLWriteroperator= (const XMLWriter &)
 No assignment. More...
 

Private Attributes

xercesc::DOMImplementation * _impl
 
xercesc::DOMWriter * _writer
 
XMLErrorHandler _errorHandler
 

Detailed Description

Wrapper class around xerces-c DOMWriter to write XML.

Constructor & Destructor Documentation

XMLWriter::XMLWriter ( )
throw (nidas::core::XMLException
)

Constructor.

XMLWriter::~XMLWriter ( )
virtual

Nuke the XMLWriter.

This does a release() (delete) of the associated DOMWriter.

nidas::core::XMLWriter::XMLWriter ( const XMLWriter )
private

No copying.

Member Function Documentation

XMLWriter& nidas::core::XMLWriter::operator= ( const XMLWriter )
private

No assignment.

void XMLWriter::setCanonicalForm ( bool  val)

Canonicalize the output.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMWriterFeatures

Parameters
valtrue: is not supported in Xerces-c. Default: false.
void XMLWriter::setDiscardDefaultContent ( bool  val)

Discard default content.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMWriterFeatures

Parameters
valBoolean value specifying whether to discard default values of attributes and content. Default: true.
void XMLWriter::setEntities ( bool  val)

Control writing of entities.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMWriterFeatures

Parameters
valtrue: entity references are serialized as
* &entityName; 
. If false, entity references are expanded. Default: true.
void XMLWriter::setFilter ( xercesc::DOMWriterFilter *  filter)
void XMLWriter::setNormalizeCharacters ( bool  val)

Normalize characters.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMWriterFeatures

Parameters
valtrue is not supported by Xerces-c. Default: false.
void XMLWriter::setPrettyPrint ( bool  val)

Format pretty-print.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMWriterFeatures

Parameters
valtrue: add whitespace to produce an indented form. Default: false.

Referenced by nidas::core::Datasets::writeXML(), and nidas::core::ProjectConfigs::writeXML().

void XMLWriter::setSplitCDATASections ( bool  val)

Split CDATA sections.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMWriterFeatures

Parameters
valtrue: split CDATA sections containing ']]>' or unrepresentable characters in the output encoding. false: signal an errror. Default: true.
void XMLWriter::setValidation ( bool  val)

Validation.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMWriterFeatures

Parameters
valfalse: do not report validation errors. true: not supported by Xerces-c. Default: false.
void XMLWriter::setWhitespaceInElement ( bool  val)

Whitespace in element content.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMWriterFeatures

Parameters
valtrue: include text nodes that can be considered ignorable whitespace in the DOM tree. false: not supported by Xerces-c. Default: true.
void nidas::core::XMLWriter::setXMLDeclaration ( bool  val)

Include xml declaration.

See /link http://xml.apache.org/xerces-c/program-dom.html#DOMWriterFeatures

Parameters
valtrue: include xml declaration. Default: true.
void XMLWriter::write ( xercesc::DOMDocument *  doc,
const std::string &  fileName 
)
throw (nidas::core::XMLException,
nidas::util::IOException
)
virtual
void XMLWriter::writeNode ( xercesc::XMLFormatTarget *const  dest,
const xercesc::DOMNode &  node 
)
throw (nidas::core::XMLException,
nidas::util::IOException
)
virtual

Member Data Documentation

XMLErrorHandler nidas::core::XMLWriter::_errorHandler
private
xercesc::DOMImplementation* nidas::core::XMLWriter::_impl
private
xercesc::DOMWriter* nidas::core::XMLWriter::_writer
private

The documentation for this class was generated from the following files: