QtiPlot  0.9.8.2
FitModelHandler.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : FitModelHandler.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2007 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : An XML handler for the Fit class
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef FITMODELHANDLER_H
30 #define FITMODELHANDLER_H
31 
32 #include <QXmlDefaultHandler>
33 #include <QVarLengthArray>
34 
35 class Fit;
36 
37 class FitModelHandler : public QXmlDefaultHandler
38 {
39 public:
40  FitModelHandler(Fit *fit);
41 
42  bool startElement(const QString &namespaceURI, const QString &localName,
43  const QString &qName, const QXmlAttributes &attributes);
44  bool endElement(const QString &namespaceURI, const QString &localName,
45  const QString &qName);
46  bool characters(const QString &str);
47  bool fatalError(const QXmlParseException &){return false;};
48  QString errorString() const;
49 
50 private:
52  bool metFitTag;
53  QString currentText;
54  QString errorStr;
55  QString d_formula;
56  QStringList d_parameters;
57  QStringList d_explanations;
58  QVarLengthArray<double> d_values;
59 };
60 
61 #endif
QString errorStr
Definition: FitModelHandler.h:54
bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &attributes)
Definition: FitModelHandler.cpp:40
QString currentText
Definition: FitModelHandler.h:53
Fit * d_fit
Definition: FitModelHandler.h:51
QStringList d_parameters
Definition: FitModelHandler.h:56
FitModelHandler(Fit *fit)
Definition: FitModelHandler.cpp:34
Definition: FitModelHandler.h:37
bool fatalError(const QXmlParseException &)
Definition: FitModelHandler.h:47
Fit base class.
Definition: Fit.h:44
bool characters(const QString &str)
Definition: FitModelHandler.cpp:88
bool metFitTag
Definition: FitModelHandler.h:52
QVarLengthArray< double > d_values
Definition: FitModelHandler.h:58
QStringList d_explanations
Definition: FitModelHandler.h:57
QString d_formula
Definition: FitModelHandler.h:55
bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Definition: FitModelHandler.cpp:63
QString errorString() const
Definition: FitModelHandler.cpp:94