Marble

KmlSchemaTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2014 Abhinav Gangwar <abhgang@gmail.com>
4//
5
6#include "KmlSchemaTagWriter.h"
7
8#include "GeoDataSchema.h"
9#include "GeoDataSimpleField.h"
10#include "GeoDataTypes.h"
11#include "GeoWriter.h"
12#include "KmlElementDictionary.h"
13#include "KmlObjectTagWriter.h"
14
15namespace Marble
16{
17
18static GeoTagWriterRegistrar s_writerSchema(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataSchemaType),
19 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
20 new KmlSchemaTagWriter);
21
22bool KmlSchemaTagWriter::write(const GeoNode *node, GeoWriter &writer) const
23{
24 const auto schema = static_cast<const GeoDataSchema *>(node);
25 writer.writeStartElement(QString::fromUtf8(kml::kmlTag_Schema));
26 KmlObjectTagWriter::writeIdentifiers(writer, schema);
27 QString name = schema->schemaName();
28 writer.writeAttribute(QStringLiteral("name"), name);
29
30 for (const GeoDataSimpleField &simpleField : schema->simpleFields()) {
31 writeElement(&simpleField, writer);
32 }
33
34 writer.writeEndElement();
35
36 return true;
37}
38
39}
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
QString name(StandardAction id)
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.