SciDAVis  1.D4
Public Member Functions | Private Member Functions | Private Attributes
XmlStreamReader Class Reference

XML stream parser that supports errors as well as warnings. More...

#include <XmlStreamReader.h>

List of all members.

Public Member Functions

 CLASS_ACCESSOR (QString, d_error_prefix, errorPrefix, ErrorPrefix)
 CLASS_ACCESSOR (QString, d_error_postfix, errorPostfix, ErrorPostfix)
 CLASS_ACCESSOR (QString, d_warning_prefix, warningPrefix, WarningPrefix)
 CLASS_ACCESSOR (QString, d_warning_postfix, warningPostfix, WarningPostfix)
bool hasWarnings () const
void raiseError (const QString &message=QString())
void raiseWarning (const QString &message=QString())
int readAttributeInt (const QString &name, bool *ok)
 Read an XML attribute and convert it to int.
bool skipToEndElement ()
 Go to the end element tag of the current element.
bool skipToNextTag ()
 Go to the next start or end element tag.
QStringList warningStrings () const
 XmlStreamReader ()
 XmlStreamReader (QIODevice *device)
 XmlStreamReader (const QByteArray &data)
 XmlStreamReader (const QString &data)
 XmlStreamReader (const char *data)

Private Member Functions

void init ()

Private Attributes

QString d_error_postfix
QString d_error_prefix
QString d_warning_postfix
QString d_warning_prefix
QStringList d_warnings

Detailed Description

XML stream parser that supports errors as well as warnings.

This class also adds line and column numbers to the error message.


Constructor & Destructor Documentation

XmlStreamReader::XmlStreamReader ( )

References init().

XmlStreamReader::XmlStreamReader ( QIODevice *  device)

References init().

XmlStreamReader::XmlStreamReader ( const QByteArray &  data)

References init().

XmlStreamReader::XmlStreamReader ( const QString &  data)

References init().

XmlStreamReader::XmlStreamReader ( const char *  data)

References init().


Member Function Documentation

XmlStreamReader::CLASS_ACCESSOR ( QString  ,
d_error_prefix  ,
errorPrefix  ,
ErrorPrefix   
)
XmlStreamReader::CLASS_ACCESSOR ( QString  ,
d_error_postfix  ,
errorPostfix  ,
ErrorPostfix   
)
XmlStreamReader::CLASS_ACCESSOR ( QString  ,
d_warning_prefix  ,
warningPrefix  ,
WarningPrefix   
)
XmlStreamReader::CLASS_ACCESSOR ( QString  ,
d_warning_postfix  ,
warningPostfix  ,
WarningPostfix   
)
bool XmlStreamReader::hasWarnings ( ) const
void XmlStreamReader::init ( )
private
void XmlStreamReader::raiseError ( const QString &  message = QString())
void XmlStreamReader::raiseWarning ( const QString &  message = QString())
int XmlStreamReader::readAttributeInt ( const QString &  name,
bool *  ok 
)

Read an XML attribute and convert it to int.

Parameters:
nameattribute name
okpointer to report back whether the attribute value could be determined (may be NULL)
Returns:
the attriute value if found and converted, otherwise zero (in this case *ok is false)

Referenced by Project::load(), future::Matrix::load(), future::Table::load(), future::Matrix::readCellElement(), future::Table::readColumnWidthElement(), future::Matrix::readColumnWidthElement(), future::Matrix::readCoordinatesElement(), future::Matrix::readDisplayElement(), future::Matrix::readRowHeightElement(), Column::XmlReadFormula(), Column::XmlReadMask(), and Column::XmlReadRow().

bool XmlStreamReader::skipToEndElement ( )

Go to the end element tag of the current element.

If the end of the document is reached, an error is raised.

Returns:
false if end of document reached, otherwise true

References raiseError().

Referenced by future::Folder::load(), Project::load(), future::Matrix::load(), future::Table::load(), AbstractSimpleFilter::load(), Column::load(), future::Folder::readChildAspectElement(), future::Matrix::readCoordinatesElement(), future::Matrix::readDisplayElement(), and Column::XmlReadMask().

bool XmlStreamReader::skipToNextTag ( )

Go to the next start or end element tag.

If the end of the document is reached, an error is raised.

Returns:
false if end of document reached, otherwise true

References raiseError().

Referenced by Project::load(), future::Folder::readChildAspectElement(), Column::XmlReadInputFilter(), and Column::XmlReadOutputFilter().

QStringList XmlStreamReader::warningStrings ( ) const

Member Data Documentation

QString XmlStreamReader::d_error_postfix
private

Referenced by init(), and raiseError().

QString XmlStreamReader::d_error_prefix
private

Referenced by init(), and raiseError().

QString XmlStreamReader::d_warning_postfix
private

Referenced by init(), and raiseWarning().

QString XmlStreamReader::d_warning_prefix
private

Referenced by init(), and raiseWarning().

QStringList XmlStreamReader::d_warnings
private

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