File indexing completed on 2025-01-05 03:59:27

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2011 Thibaut Gridel <tgridel@free.fr>
0004 
0005 #include "GpxParser.h"
0006 
0007 #include "GPXElementDictionary.h"
0008 #include "GeoDataDocument.h"
0009 
0010 namespace Marble
0011 {
0012 
0013 GpxParser::GpxParser()
0014     : GeoParser( 0 )
0015 {
0016 }
0017 
0018 GpxParser::~GpxParser()
0019 {
0020 }
0021 
0022 bool GpxParser::isValidRootElement()
0023 {
0024     return isValidElement(QString::fromUtf8(gpx::gpxTag_gpx));
0025 }
0026 
0027 bool GpxParser::isValidElement(const QString& tagName) const
0028 {
0029     if (!GeoParser::isValidElement(tagName))
0030     {
0031         return false;
0032     }
0033 
0034     return (
0035             (namespaceUri() == QStringView(QString::fromUtf8(gpx::gpxTag_nameSpace10)))    ||
0036             (namespaceUri() == QStringView(QString::fromUtf8(gpx::gpxTag_nameSpace11)))    ||
0037             (namespaceUri() == QStringView(QString::fromUtf8(gpx::gpxTag_nameSpaceGarminTrackPointExt1)))
0038            );
0039 }
0040 
0041 GeoDocument* GpxParser::createDocument() const
0042 {
0043     return new GeoDataDocument;
0044 }
0045 
0046 }