• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • kde-4.x
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • writer
GeoWriter.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2009 Andrew Manson <[email protected]>
9 //
10 
11 #ifndef MARBLE_GEOWRITER_H
12 #define MARBLE_GEOWRITER_H
13 
14 #include "marble_export.h"
15 
16 #include <QXmlStreamWriter>
17 #include <QVariant>
18 
19 namespace Marble
20 {
21 
22 class GeoNode;
23 
30 class MARBLE_EXPORT GeoWriter : public QXmlStreamWriter
31 {
32 public:
33  GeoWriter();
34 
42  bool write( QIODevice* device, const GeoNode *feature);
43 
50  void setDocumentType( const QString& documentType );
51 
56  void writeElement( const QString &namespaceUri, const QString &key, const QString &value );
57 
62  void writeElement( const QString &key, const QString &value );
63 
69  void writeOptionalElement(const QString &key, const QString &value , const QString &defaultValue = QString() );
70 
75  void writeOptionalAttribute( const QString &key, const QString &value, const QString &defaultValue = QString() );
76 
77  template<class T>
78  void writeOptionalElement( const QString &key, const T &value , const T &defaultValue = T() )
79  {
80  if ( value != defaultValue ) {
81  writeElement( key, QVariant::fromValue( value ).toString() );
82  }
83  }
84 
85 private:
86  friend class GeoTagWriter;
87  friend class GeoDataDocumentWriter;
88  bool writeElement( const GeoNode* object );
89 
90 private:
91  QString m_documentType;
92 };
93 
94 }
95 
96 #endif
QIODevice
QXmlStreamWriter
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:49
Marble::GeoWriter::writeOptionalElement
void writeOptionalElement(const QString &key, const T &value, const T &defaultValue=T())
Definition: GeoWriter.h:78
Marble::GeoTagWriter
Base class intended to be subclassed by specific XML tag writers This class provides a base class tha...
Definition: GeoTagWriter.h:32
Marble::GeoWriter
Standard Marble way of writing XML This class is intended to be a standardised way of writing XML for...
Definition: GeoWriter.h:30
QString
QVariant::fromValue
QVariant fromValue(const T &value)
Marble::GeoDataDocumentWriter
Write GeoDataDocument content to I/O devices (e.g.
Definition: GeoDataDocumentWriter.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Dec 9 2019 01:02:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  •   KmPlot
  • libkeduvocdocument
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   src
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal