Marble

KmlDataTagWriter.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 "KmlDataTagWriter.h"
7
8#include "GeoDataData.h"
9#include "GeoDataTypes.h"
10#include "GeoWriter.h"
11#include "KmlElementDictionary.h"
12
13namespace Marble
14{
15
16static GeoTagWriterRegistrar s_writerData(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataDataType),
17 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
18 new KmlDataTagWriter());
19
20bool KmlDataTagWriter::write(const GeoNode *node, GeoWriter &writer) const
21{
22 const auto data = static_cast<const GeoDataData *>(node);
23
24 writer.writeStartElement(QString::fromLatin1(kml::kmlTag_Data));
25 writer.writeAttribute(QStringLiteral("name"), data->name());
26 writer.writeOptionalElement(QString::fromLatin1(kml::kmlTag_displayName), data->displayName());
27 writer.writeElement(QStringLiteral("value"), data->value().toString());
28 writer.writeEndElement();
29
30 return true;
31}
32
33}
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)
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.