labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

XmlStreamReader Class Reference

XML stream parser that supports errors as well as warnings. This class also adds line and column numbers to the error message. More...

#include <XmlStreamReader.h>

Inheritance diagram for XmlStreamReader:
[legend]
Collaboration diagram for XmlStreamReader:
[legend]

Public Member Functions

 XmlStreamReader ()
 
 XmlStreamReader (QIODevice *device)
 
 XmlStreamReader (const QByteArray &data)
 
 XmlStreamReader (const QString &data)
 
 XmlStreamReader (const char *data)
 
const QStringList & warningStrings () const
 
QString missingCASWarning () const
 
bool hasWarnings () const
 
bool hasMissingCASWarnings () const
 
void setFailedCASMissing (bool)
 
bool failedCASMissing () const
 
void raiseWarning (const QString &)
 
void raiseMissingCASWarning (const QString &)
 
void raiseError (const QString &)
 
bool skipToNextTag ()
 
bool skipToEndElement ()
 
int readAttributeInt (const QString &name, bool *ok)
 

Private Member Functions

void init ()
 

Private Attributes

QStringList m_warnings
 
QStringList m_missingCASPlugins
 
bool m_failedCASMissing {false}
 

Detailed Description

XML stream parser that supports errors as well as warnings. This class also adds line and column numbers to the error message.

File : XmlStreamReader.cpp Project : LabPlot

Description : XML stream parser that supports errors and warnings

Copyright : (C) 2009 Tilman Benkert (thzs@.nosp@m.gmx..nosp@m.net) Copyright : (C) 2015-2016 Alexander Semke (alexa.nosp@m.nder.nosp@m..semk.nosp@m.e@we.nosp@m.b.de)

  • This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *
  • This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *
  • You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA *

Definition at line 37 of file XmlStreamReader.h.

Constructor & Destructor Documentation

◆ XmlStreamReader() [1/5]

XmlStreamReader::XmlStreamReader ( )
default

◆ XmlStreamReader() [2/5]

XmlStreamReader::XmlStreamReader ( QIODevice *  device)
explicit

Definition at line 39 of file XmlStreamReader.cpp.

◆ XmlStreamReader() [3/5]

XmlStreamReader::XmlStreamReader ( const QByteArray &  data)
explicit

Definition at line 42 of file XmlStreamReader.cpp.

◆ XmlStreamReader() [4/5]

XmlStreamReader::XmlStreamReader ( const QString &  data)
explicit

Definition at line 45 of file XmlStreamReader.cpp.

◆ XmlStreamReader() [5/5]

XmlStreamReader::XmlStreamReader ( const char *  data)
explicit

Definition at line 48 of file XmlStreamReader.cpp.

Member Function Documentation

◆ failedCASMissing()

bool XmlStreamReader::failedCASMissing ( ) const

returns true if the loading of an project object failed because of the missing CAS functionality (no CAS support or missing CAS plugin). returns false if the loadign failed because of other reasons like broken XML or missing important and required attributes.

Definition at line 99 of file XmlStreamReader.cpp.

References m_failedCASMissing.

Referenced by Folder::readChildAspectElement().

◆ hasMissingCASWarnings()

bool XmlStreamReader::hasMissingCASWarnings ( ) const

Definition at line 85 of file XmlStreamReader.cpp.

References m_missingCASPlugins.

Referenced by Project::load().

◆ hasWarnings()

bool XmlStreamReader::hasWarnings ( ) const

Definition at line 81 of file XmlStreamReader.cpp.

References m_warnings.

Referenced by Project::load().

◆ init()

void XmlStreamReader::init ( )
private

◆ missingCASWarning()

QString XmlStreamReader::missingCASWarning ( ) const

Definition at line 62 of file XmlStreamReader.cpp.

References i18n, and m_missingCASPlugins.

Referenced by Project::load().

◆ raiseError()

void XmlStreamReader::raiseError ( const QString &  message)

◆ raiseMissingCASWarning()

void XmlStreamReader::raiseMissingCASWarning ( const QString &  name)

Definition at line 111 of file XmlStreamReader.cpp.

References m_missingCASPlugins.

Referenced by CantorWorksheet::load(), and Folder::readChildAspectElement().

◆ raiseWarning()

◆ readAttributeInt()

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 attribute value if found and converted, otherwise zero (in this case *ok is false)

Definition at line 170 of file XmlStreamReader.cpp.

Referenced by AbstractColumn::XmlReadMask(), and Column::XmlReadRow().

◆ setFailedCASMissing()

void XmlStreamReader::setFailedCASMissing ( bool  value)

Definition at line 89 of file XmlStreamReader.cpp.

References m_failedCASMissing.

Referenced by CantorWorksheet::load().

◆ skipToEndElement()

◆ skipToNextTag()

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

Definition at line 120 of file XmlStreamReader.cpp.

References i18n, and raiseError().

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

◆ warningStrings()

const QStringList & XmlStreamReader::warningStrings ( ) const

Definition at line 51 of file XmlStreamReader.cpp.

References m_warnings.

Referenced by Project::load().

Member Data Documentation

◆ m_failedCASMissing

bool XmlStreamReader::m_failedCASMissing {false}
private

Definition at line 65 of file XmlStreamReader.h.

Referenced by failedCASMissing(), and setFailedCASMissing().

◆ m_missingCASPlugins

QStringList XmlStreamReader::m_missingCASPlugins
private

◆ m_warnings

QStringList XmlStreamReader::m_warnings
private

Definition at line 63 of file XmlStreamReader.h.

Referenced by hasWarnings(), raiseWarning(), and warningStrings().


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