Marble

DgmlGeodataTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2011 Utku Aydın <utkuaydin34@gmail.com>
4//
5
6#include "DgmlGeodataTagWriter.h"
7
8#include "DgmlElementDictionary.h"
9#include "GeoSceneGeodata.h"
10#include "GeoSceneTypes.h"
11#include "GeoWriter.h"
12
13namespace Marble
14{
15
16static GeoTagWriterRegistrar s_writerGeodata(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoSceneTypes::GeoSceneGeodataType),
17 QString::fromLatin1(dgml::dgmlTag_nameSpace20)),
18 new DgmlGeodataTagWriter());
19
20bool DgmlGeodataTagWriter::write(const GeoNode *node, GeoWriter &writer) const
21{
22 const auto geodata = static_cast<const GeoSceneGeodata *>(node);
23 writer.writeStartElement(QString::fromUtf8(dgml::dgmlTag_Geodata));
24 writer.writeAttribute(QStringLiteral("name"), geodata->name());
25
26 writer.writeStartElement(QString::fromUtf8(dgml::dgmlTag_SourceFile));
27 writer.writeCharacters(geodata->sourceFile());
28 writer.writeEndElement();
29
30 writer.writeEndElement();
31 return true;
32}
33
34}
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:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.