SDX::Helpers::StreamReader Class Reference

Anything that can read from a stream, for example XmlStreamReader or TabBasedStreamReader. More...

#include <SDXStreamReader.h>

Inheritance diagram for SDX::Helpers::StreamReader:

SDX::ResourceReader SDX::Formats::CsvStreamReader SDX::Formats::TabBasedStreamReader SDX::Formats::XmlStreamReader

List of all members.

Public Member Functions

 StreamReader (std::istream *iStream=0, SDX::ContentHandler *contentHandler=0)
 Constructor.
void setStream (std::istream *iStream)
 Set the stream to read from.

Protected Member Functions

virtual void openStream ()
 Reimplement this if the stream needs to open and use setStream() to set the stream that's ready to read from.
virtual void closeStream ()
 Reimplement this if the stream needs to close after usage.
virtual void startProcessing ()
 Reimplement this if you need to do something before processing any lines.
virtual void endProcessing ()
 Reimplement this if you need to do something after processing all of the lines.
virtual bool processLine (std::string &line)=0
 This function gets called for each line that is read from the stream.
void setError (std::string message)
 If aomething goes wrong during the processing of document, use this function to indicate what went wrong.


Detailed Description

Anything that can read from a stream, for example XmlStreamReader or TabBasedStreamReader.

A stream is derived from std::istream and could read from a file (see the FileReader class) or for example read from a string (see std::istringstream).

Definition at line 11 of file SDXStreamReader.h.


Member Function Documentation

void StreamReader::openStream (  )  [protected, virtual]

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

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

Definition at line 42 of file SDXStreamReader.cpp.

void SDX::Helpers::StreamReader::setStream ( std::istream *  iStream  ) 

Set the stream to read from.

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


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