Marble

KmlSchemaTagWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2014 Abhinav Gangwar <[email protected]>
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 
15 namespace Marble
16 {
17 
18 static GeoTagWriterRegistrar s_writerSchema(
19  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataSchemaType,
20  kml::kmlTag_nameSpaceOgc22),
21  new KmlSchemaTagWriter );
22 
23 bool KmlSchemaTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
24 {
25  const GeoDataSchema *schema = static_cast<const GeoDataSchema*>( node );
26  writer.writeStartElement( kml::kmlTag_Schema );
27  KmlObjectTagWriter::writeIdentifiers( writer, schema );
28  QString name = schema->schemaName();
29  writer.writeAttribute( "name", name );
30 
31  for( const GeoDataSimpleField &simpleField: schema->simpleFields() ) {
32  writeElement( &simpleField, writer );
33  }
34 
35  writer.writeEndElement();
36 
37  return true;
38 }
39 
40 }
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Definition: GeoTagWriter.h:44
Binds a QML item to a specific geodetic location in screen coordinates.
const char * name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.