2 * This file is part of jSpeed.
4 * jSpeed 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 3 of the License, or
7 * (at your option) any later version.
9 * jSpeed 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 jSpeed. If not, see <http://www.gnu.org/licenses/>.
19 #include "poireader.h"
20 #include "poiascreader.h"
24 QString const READER_FILETYPES[PoiReader::READER_COUNT] = {"asc"};
27 PoiReader::PoiReader()
31 PoiReader* PoiReader::getReader(QString const& filename)
33 QString lower = filename.toLower();
35 Reader reader = READER_COUNT;
37 for(int i = 0; i < READER_COUNT; i++)
39 if(lower.right(READER_FILETYPES[i].size()) == READER_FILETYPES[i])
41 reader = static_cast<Reader>(i);
49 return new PoiAscReader(filename);
56 void PoiReader::setError(QString const& error)
61 QString const& PoiReader::error()
66 QString PoiReader::getFormatPattern()
70 for(int i = 0; i < READER_COUNT; i++)
72 data += "*." + READER_FILETYPES[i] + " ";
75 return data.trimmed();
78 void PoiReader::getSupportedFormats(QList<QString>& formats)
82 for(int i = 0; i < READER_COUNT; i++)
84 formats.push_back(READER_FILETYPES[i]);