Marble

KmlTimeSpanWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2012 Shou Ya <shouyatf@gmail.com>
4//
5
6#include "KmlTimeSpanWriter.h"
7
8#include "GeoDataTimeSpan.h"
9#include "GeoDataTypes.h"
10#include "GeoWriter.h"
11#include "KmlElementDictionary.h"
12#include "KmlObjectTagWriter.h"
13#include "KmlTimeStampTagWriter.h"
14
15namespace Marble
16{
17
18static GeoTagWriterRegistrar s_writerLookAt(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataTimeSpanType),
19 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
20 new KmlTimeSpanWriter);
21
22bool KmlTimeSpanWriter::write(const GeoNode *node, GeoWriter &writer) const
23{
24 Q_ASSERT(dynamic_cast<const GeoDataTimeSpan *>(node));
25 const auto timespan = static_cast<const GeoDataTimeSpan *>(node);
26
27 writer.writeStartElement(QString::fromUtf8(kml::kmlTag_TimeSpan));
28 KmlObjectTagWriter::writeIdentifiers(writer, timespan);
29
30 writer.writeTextElement("begin", KmlTimeStampTagWriter::toString(timespan->begin()));
31 writer.writeTextElement("end", KmlTimeStampTagWriter::toString(timespan->end()));
32
33 writer.writeEndElement();
34
35 return true;
36}
37
38}
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 Dec 20 2024 11:52:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.