Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

DataXML::InputXMLStream Class Reference

Input stream for XML data objects. More...

#include <XMLStream.h>

List of all members.

Public Methods

 InputXMLStream ()
 use cin as a default istream. More...

 InputXMLStream (std::istream &)
 set default istream, default stream is stored externally and must not cease to exist before it is released by setDefaultStream(). More...

 ~InputXMLStream ()
 clean up buffers. More...

const DataObjectread ()
 read-in a data object from default stream success() tells if the operation was successful. More...

const DataObjectread (std::istream &)
 read-in a data object from specified stream, success() tells if the operation was successful. More...

bool success () const
 true if last read successful. More...

std::string errorName () const
 error explanation if success()==false. More...

std::string errorSourcePoint () const
 portion of source text around which error was detected. More...

std::istream& getDefaultStream () const
 get default stream. More...

void setDefaultStream (std::istream &=std::cin)
 change default stream, release previous default stream (not used anymore). More...


Private Methods

void _init (std::istream &)

Private Attributes

XMLParserImplementation* m_impl
 pointer to implementation. More...

char* m_SRC_BUF
 buffered streaming (XML parsers deal with memory not streams). More...

int m_BUF_SIZE
 size of the buffer. More...

bool m_success
 success flag. More...

std::istream* m_def_stream
 default stream. More...


Detailed Description

Buffering and error handling. You can specify the stream for every read() separately or set a default stream. Because default stream is stored externally, you should make sure stream is not destroyed while it is set default.
Examples:

dxml_copy_example.cpp, and dxml_read_example.cpp.

Definition at line 32 of file XMLStream.h.


Constructor & Destructor Documentation

DataXML::InputXMLStream::InputXMLStream ( )
 

DataXML::InputXMLStream::InputXMLStream ( std::istream & )
 

DataXML::InputXMLStream::~InputXMLStream ( )
 


Member Function Documentation

void DataXML::InputXMLStream::_init ( std::istream & ) [private]
 

std::string DataXML::InputXMLStream::errorName ( ) const
 

std::string DataXML::InputXMLStream::errorSourcePoint ( ) const
 

std::istream & DataXML::InputXMLStream::getDefaultStream ( ) const
 

const DataObject & DataXML::InputXMLStream::read ( std::istream & )
 

const DataObject & DataXML::InputXMLStream::read ( )
 

Examples:
dxml_read_example.cpp.

Referenced by main().

void DataXML::InputXMLStream::setDefaultStream ( std::istream & = std::cin )
 

bool DataXML::InputXMLStream::success ( ) const
 

Examples:
dxml_read_example.cpp.

Referenced by main().


Member Data Documentation

int DataXML::InputXMLStream::m_BUF_SIZE [private]
 

Definition at line 82 of file XMLStream.h.

char * DataXML::InputXMLStream::m_SRC_BUF [private]
 

Definition at line 79 of file XMLStream.h.

std::istream * DataXML::InputXMLStream::m_def_stream [private]
 

Definition at line 88 of file XMLStream.h.

XMLParserImplementation * DataXML::InputXMLStream::m_impl [private]
 

Definition at line 76 of file XMLStream.h.

bool DataXML::InputXMLStream::m_success [private]
 

Definition at line 85 of file XMLStream.h.


The documentation for this class was generated from the following file:
Generated at Tue Jan 28 15:35:29 2003 for DataXML by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001