Marble

KmlSchemaDataTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2014 Abhinav Gangwar <abhgang@gmail.com>
4//
5
6#include "KmlSchemaDataTagWriter.h"
7
8#include <QString>
9
10#include "KmlElementDictionary.h"
11
12#include "GeoWriter.h"
13
14#include "GeoDataTypes.h"
15
16#include "GeoDataSchemaData.h"
17#include "GeoDataSimpleData.h"
18
19namespace Marble
20{
21
22static GeoTagWriterRegistrar s_writerSchemaData(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataSchemaDataType),
23 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
24 new KmlSchemaDataTagWriter);
25
26bool KmlSchemaDataTagWriter::write(const GeoNode *node, GeoWriter &writer) const
27{
28 const auto schemaData = static_cast<const GeoDataSchemaData *>(node);
29 writer.writeStartElement(QString::fromUtf8(kml::kmlTag_SchemaData));
30 QString schemaUrl = schemaData->schemaUrl();
31 writer.writeAttribute("schemaUrl", schemaUrl);
32
33 for (const GeoDataSimpleData &data : schemaData->simpleDataList()) {
34 writeElement(&data, writer);
35 }
36 writer.writeEndElement();
37
38 return true;
39}
40
41}
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Binds a QML item to a specific geodetic location in screen coordinates.
QString fromLatin1(QByteArrayView str)
QString fromUtf8(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.