Marble

KmlExtendedDataTagWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Gaurav Gupta <[email protected]>
4 //
5 
6 
7 #include "KmlExtendedDataTagWriter.h"
8 
9 #include "GeoDataTypes.h"
10 #include "GeoWriter.h"
11 #include "KmlElementDictionary.h"
12 #include "GeoDataExtendedData.h"
13 #include "GeoDataData.h"
14 #include "GeoDataSchemaData.h"
15 
16 #include <QHash>
17 
18 namespace Marble
19 {
20 
21 static GeoTagWriterRegistrar s_writerExtendedData( GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataExtendedDataType,
22  kml::kmlTag_nameSpaceOgc22 ),
23  new KmlExtendedDataTagWriter() );
24 
25 
26 bool KmlExtendedDataTagWriter::write( const GeoNode *node,
27  GeoWriter& writer ) const
28 {
29  const GeoDataExtendedData *extended = static_cast<const GeoDataExtendedData*>( node );
30 
31  writer.writeStartElement( kml::kmlTag_ExtendedData );
32 
35 
36  for( QHash< QString, GeoDataData >::const_iterator i = begin; i != end; ++i ){
37  writeElement( &i.value(), writer );
38  }
39 
40  for( const GeoDataSchemaData &schemaData: extended->schemaDataList() ) {
41  writeElement( &schemaData, writer );
42  }
43 
44  writer.writeEndElement();
45 
46  return true;
47 }
48 
49 }
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
const QList< QKeySequence > & begin()
Binds a QML item to a specific geodetic location in screen coordinates.
const QList< QKeySequence > & end()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.