Initial Commit
[HECS.git] / Sedbuk.h
blob8a097686033d0df837339b61bc8ded3ca7f27fac
2 /***************************************************************************
3 * *
4 * Sedbuk.cpp Copyright (C) 2008 by Jon Rumble *
5 * j.w.rumble@reading.ac.uk *
6 * *
7 * This file is part of HECS, *
8 * *
9 * HECS is free software: you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation, either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 * HECS is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17 * GNU General Public License for more details. *
18 * *
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
22 ***************************************************************************/
24 #ifndef SEDBUK_H
25 #define SEDBUK_H
27 #include <QString>
28 #include <QVector>
29 #include <QTextStream>
30 #include <QFile>
31 #include <QHash>
32 #include <QHashIterator>
33 #include <QStringList>
34 #include <iostream>
35 #include <QDate>
36 #include "Boiler.h"
37 #include "Misc.h"
38 #include <iostream>
39 class SedbukList {
41 public:
43 SedbukList (const QString fileNameIn);
44 ~SedbukList ();
45 void updateSedbukDatabase();
46 QString get_revisionDate();
47 bool get_sedbukAvail();
48 QString fileName;
49 QStringList getBrandList(int fuel_type);
50 QStringList getModelList (QString brandNameIn);
51 Boiler findBoiler (const QString& modelStr);
52 QStringList getBoilerBrands(int fuel_type);
53 protected:
54 void openFile(QString fileName);
56 private:
58 bool m_sedbukAvail;
59 bool m_updateFlag;
60 int Sedbuk_revision;
61 QDate Sedbuk_date;
62 int m_revisionNum;
63 int m_day;
64 int m_month;
65 int m_year;
66 QString m_revisionDate;
67 QHash<QString, Boiler> boilerHash;
68 void parseVersion(QString versionString);
69 void parseBoilerTable(QString parseStr);
70 void initVars();
72 int m_fuelType;
77 #endif