Marble

KmlExtendedDataTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Gaurav Gupta <1989.gaurav@googlemail.com>
4//
5
6#include "KmlExtendedDataTagWriter.h"
7
8#include "GeoDataData.h"
9#include "GeoDataExtendedData.h"
10#include "GeoDataSchemaData.h"
11#include "GeoDataTypes.h"
12#include "GeoWriter.h"
13#include "KmlElementDictionary.h"
14
15#include <QHash>
16
17namespace Marble
18{
19
20static GeoTagWriterRegistrar s_writerExtendedData(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataExtendedDataType),
21 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
22 new KmlExtendedDataTagWriter());
23
24bool KmlExtendedDataTagWriter::write(const GeoNode *node, GeoWriter &writer) const
25{
26 const auto extended = static_cast<const GeoDataExtendedData *>(node);
27
28 writer.writeStartElement(QString::fromUtf8(kml::kmlTag_ExtendedData));
29
32
33 for (QHash<QString, GeoDataData>::const_iterator i = begin; i != end; ++i) {
34 writeElement(&i.value(), writer);
35 }
36
37 for (const GeoDataSchemaData &schemaData : extended->schemaDataList()) {
38 writeElement(&schemaData, writer);
39 }
40
41 writer.writeEndElement();
42
43 return true;
44}
45
46}
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
const QList< QKeySequence > & begin()
const QList< QKeySequence > & end()
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 Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.