File indexing completed on 2025-02-02 05:02:40
0001 /* 0002 SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef GPX_READER_H 0008 #define GPX_READER_H 0009 0010 #include <QXmlStreamReader> 0011 0012 namespace Gpx { 0013 0014 /** GPX reader. */ 0015 class Reader : public QXmlStreamReader 0016 { 0017 public: 0018 using QXmlStreamReader::QXmlStreamReader; 0019 0020 /** Returns @c true for the top-level element. */ 0021 bool isRootElement() const; 0022 0023 /** Returns @c true if we are positioned on a waypoint start element. */ 0024 bool isWaypointStart() const; 0025 /** Returns @c true if we are positioned on a waypoint end element. */ 0026 bool isWaypointEnd() const; 0027 0028 /** Returns the latitude of the current waypoint, route point or track point. */ 0029 float latitude() const; 0030 /** Returns the longitude of the current waypoint, route point or track point. */ 0031 float longitude() const; 0032 0033 /** Returns @c true if the current element is a name property. */ 0034 bool isGpxName() const; 0035 /** Returns the value of a GPX name property. */ 0036 QString gpxName(); 0037 /** Returns @c true if the current element is a GPX type property. */ 0038 bool isGpxType() const; 0039 /** Returns the value of a GPX type property. */ 0040 QString gpxType(); 0041 }; 0042 0043 } 0044 0045 #endif // GPX_READER_H