KWeatherCore

feedparser.h
1/*
2 * SPDX-FileCopyrightText: 2021 Han Young <hanyoung@protonmail.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#pragma once
7#include "alertfeedentry.h"
8#include <QJsonDocument>
9#include <QXmlStreamReader>
10#include <memory>
11namespace KWeatherCore
12{
13class FeedParser : public QObject
14{
16public:
17 FeedParser(const QJsonDocument &configFile, QObject *parent = nullptr);
18 void setConfig(const QJsonDocument &configFile);
19 std::unique_ptr<std::vector<std::unique_ptr<AlertFeedEntry>>> parse(const QByteArray &data) const;
20
21private:
22 std::unique_ptr<AlertFeedEntry> parseOneEntry(QXmlStreamReader &reader) const;
23 QUrl parseCapElement(QXmlStreamReader &reader) const;
24 void parsePolygonElement(QXmlStreamReader &reader, AlertFeedEntry &entry) const;
25 QUrl m_url;
26 QString m_entryMarker;
27 QString m_titleMarker;
28 bool m_hasCap;
29 QString m_capLinkElementMarker;
30 QString m_capValueType; // ie. "attribute"
31 QString m_capValueMarker; // ie. "href"
32 QString m_summaryMarker;
33 bool m_hasArea;
34 QString m_areaNameMarker;
35 QString m_polygonMarker;
36 QString m_FIPS6Marker;
37 QString m_UGCMarker;
38 QString m_urgencyMarker;
39 QString m_severityMarker;
40 QString m_certaintyMarker;
41 bool m_hasDate;
42 QString m_dateMarker;
43 QString m_dateFormat;
44};
45}
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 12:02:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.