SDX::Helpers::StreamWriter Class Reference

Anything that can write to a stream using the ContentHandler interface, for example XmlStreamWriter. More...

#include <SDXStreamWriter.h>

Inheritance diagram for SDX::Helpers::StreamWriter:

SDX::ContentHandler SDX::Formats::CsvStreamWriter SDX::Formats::TabBasedStreamWriter SDX::Formats::XmlStreamWriter

List of all members.

Public Member Functions

 StreamWriter ()
 Constructor.
bool write (SDX::Document *document)
 Write document to stream.
std::string getError ()
 If write() returned, use this function to find out what went wrong.
void setStream (std::ostream *oStream)
 Set the stream to write to.
virtual void openStream ()
 Reimplement this if the stream needs to open and use setStream() to set the stream that's ready to write to.
virtual void closeStream ()
 Reimplement this if the stream needs to close after usage.
bool isReady ()
 Returns whether the stream is ready to be written to.

Protected Attributes

std::string m_error
 If aomething goes wrong during writing of document, store the error in this variable.
std::ostream * m_oStream
 The stream to write document to.


Detailed Description

Anything that can write to a stream using the ContentHandler interface, for example XmlStreamWriter.

Definition at line 12 of file SDXStreamWriter.h.


Member Function Documentation

virtual void SDX::Helpers::StreamWriter::openStream (  )  [inline, virtual]

Reimplement this if the stream needs to open and use setStream() to set the stream that's ready to write to.

If the stream could not be opened, use setStream() to set the stream to a NULL pointer.

Definition at line 38 of file SDXStreamWriter.h.

void StreamWriter::setStream ( std::ostream *  oStream  ) 

Set the stream to write to.

This is normally called from the implementation of openStream().

Definition at line 40 of file SDXStreamWriter.cpp.


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

Generated on Mon Apr 27 16:55:50 2009 for SDX by  doxygen 1.5.8