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 "KmlParser.h" 0006 0007 #include "GeoDataDocument.h" 0008 #include "KmlElementDictionary.h" 0009 0010 namespace Marble 0011 { 0012 0013 KmlParser::KmlParser() 0014 : GeoParser( 0 ) 0015 { 0016 } 0017 0018 KmlParser::~KmlParser() 0019 { 0020 } 0021 0022 bool KmlParser::isValidRootElement() 0023 { 0024 return isValidElement(QString::fromUtf8(kml::kmlTag_kml)); 0025 } 0026 0027 bool KmlParser::isValidElement(const QString& tagName) const 0028 { 0029 if (!GeoParser::isValidElement(tagName)) 0030 return false; 0031 0032 return (namespaceUri() == QStringView(QString::fromUtf8(kml::kmlTag_nameSpace20)) || 0033 namespaceUri() == QStringView(QString::fromUtf8(kml::kmlTag_nameSpace21)) || 0034 namespaceUri() == QStringView(QString::fromUtf8(kml::kmlTag_nameSpace22)) || 0035 namespaceUri() == QStringView(QString::fromUtf8(kml::kmlTag_nameSpaceGx22)) || 0036 namespaceUri() == QStringView(QString::fromUtf8(kml::kmlTag_nameSpaceOgc22))|| 0037 namespaceUri() == QStringView(QString::fromUtf8(kml::kmlTag_nameSpaceMx)) ); 0038 } 0039 0040 GeoDocument* KmlParser::createDocument() const 0041 { 0042 return new GeoDataDocument; 0043 } 0044 0045 }