1
/***************************************************************************
2
* Copyright (C) 2005, 2006 by Carsten Niehaus <cniehaus@kde.org> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18
***************************************************************************/
20
#include "elementparser.h"
22
#include "chemicaldataobject.h"
23
#include <QtCore/QDebug>
26
int main(int argc, char *argv[])
28
if (argc < 2 || argc > 2) {
29
std::cout << "Usage: elements <XML_FILE>\n";
33
ElementSaxParser * parser = new ElementSaxParser();
34
QFile xmlFile(argv[1]);
36
QXmlInputSource source(&xmlFile);
37
QXmlSimpleReader reader;
39
reader.setContentHandler(parser);
42
QList<Element*> v = parser->getElements();
44
std::cout << "Found " << v.count() << " elements." << std::endl;
46
foreach( Element* e, v ){
49
QList<ChemicalDataObject> list = e->data();
51
//Test: give me all data available
52
foreach( const ChemicalDataObject &o, list ){
53
QString unit = o.unitAsString();
54
if ( unit == "bo:noUnit" )
56
qDebug() << "Name: " << o.type() << " " << o.valueAsString() <<" " << unit;
67
// QString dictRef( int type ) const
72
// botype = "atomicNumber";
84
// botype = "exactMass";
89
// case magneticMoment:
90
// botype = "magneticMoment";
93
// botype = "halfLife";
96
// botype = "alphaDecay";
98
// case alphaDecayLikeliness:
99
// botype = "alphaDecayLikeliness";
101
// case betaminusDecayLikeliness:
102
// botype = "betaminusDecayLikeliness";
104
// case betaminusDecay:
105
// botype = "betaminusDecay";
107
// case betaplusDecayLikeliness:
108
// botype = "betaplusDecayLikeliness";
110
// case betaplusDecay:
111
// botype = "betaplusDecay";
113
// case ecDecayLikeliness:
114
// botype = "ecDecayLikeliness";
117
// botype = "ecDecay";
120
// botype = "ionization";
122
// case electronAffinity:
123
// botype = "electronAffinity";
125
// case electronegativityPauling:
126
// botype = "electronegativityPauling";
128
// case radiusCovalent:
129
// botype = "radiusCovalent";
132
// botype = "radiusVDW";
134
// case meltingpoint:
135
// botype = "meltingpoint";
137
// case boilingpoint:
138
// botype = "boilingpoint";
140
// case periodTableBlock:
141
// botype = "periodTableBlock";
144
// botype = "nameOrigin";
153
// botype = "discoverers";
156
// botype = "period";
158
// case relativeAbundance:
159
// botype = "relativeAbundance";
167
// case acidicbehaviour:
168
// botype ="acidicbehaviour";
170
// case electronicConfiguration:
171
// botype ="electronicConfiguration";
173
// case crystalstructure:
174
// botype ="crystalstructure";
176
// case dangerSymbol:
177
// botype ="dangerSymbol";
180
// botype ="RPhrase";
183
// botype ="SPhrase";
185
// case discoveryCountry:
186
// botype ="discoveryCountry";
190
// botype = botype.prepend( QLatin1String("bo:") );
b'\\ No newline at end of file'