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

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • writer
GeoTagWriter.cpp
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 <g.real.ate@gmail.com>
9 // Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
10 //
11 
12 #include "GeoTagWriter.h"
13 
14 #include "GeoWriter.h"
15 
16 #include <QDebug>
17 
18 namespace Marble
19 {
20 
21 GeoTagWriter::GeoTagWriter()
22 {
23 }
24 
25 GeoTagWriter::~GeoTagWriter()
26 {
27 }
28 
29 bool GeoTagWriter::writeElement( const GeoNode *object,
30  GeoWriter &writer) const
31 {
32  return writer.writeElement( object );
33 }
34 
35 void GeoTagWriter::registerWriter(const QualifiedName& name,
36  const GeoTagWriter* writer )
37 {
38  TagHash* tagHash = tagWriterHash();
39 
40  if ( tagHash->contains( name ) ) {
41  qWarning() << "Warning: The tag" << name << "is already registered. Often this indicates that multiple versions of the marblewidget library are loaded at the same time. This will likely lead to problems. Please check your installation, especially internal Marble plugins and external applications that install Marble plugins.";
42  }
43  Q_ASSERT( !tagHash->contains( name ) );
44  tagHash->insert( name, writer );
45  Q_ASSERT( tagHash->contains( name ) );
46 }
47 
48 GeoTagWriter::TagHash* GeoTagWriter::tagWriterHash()
49 {
50  static TagHash s_tagWriterHash;
51  return &s_tagWriterHash;
52 }
53 
54 const GeoTagWriter* GeoTagWriter::recognizes( const QualifiedName &qname )
55 {
56  TagHash* hash = tagWriterHash();
57 
58  if( !hash->contains( qname ) ) {
59  return 0;
60  }
61 
62  return hash->value( qname );
63 }
64 
65 }
Marble::GeoTagWriter::GeoTagWriter
GeoTagWriter()
Definition: GeoTagWriter.cpp:21
GeoTagWriter.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
Marble::GeoWriter::writeElement
void writeElement(const QString &namespaceUri, const QString &key, const QString &value)
Convenience method to write value with key prefixed format namespaceUri.
Definition: GeoWriter.cpp:84
GeoWriter.h
Marble::GeoTagWriter
Base class intended to be subclassed by specific XML tag writers This class provides a base class tha...
Definition: GeoTagWriter.h:31
Marble::GeoWriter
Standard Marble way of writing XML This class is intended to be a standardised way of writing XML for...
Definition: GeoWriter.h:29
Marble::GeoTagWriter::writeElement
bool writeElement(const GeoNode *object, GeoWriter &writer) const
Definition: GeoTagWriter.cpp:29
Marble::GeoTagWriter::~GeoTagWriter
virtual ~GeoTagWriter()
Definition: GeoTagWriter.cpp:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 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
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   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