Marble::GeoWriter

Search for usage in LXR

Marble::GeoWriter Class Reference

#include <GeoWriter.h>

Inheritance diagram for Marble::GeoWriter:

Public Member Functions

void setDocumentType (const QString &documentType)
 
bool write (QIODevice *device, const GeoNode *feature)
 
void writeElement (const QString &key, const QString &value)
 
void writeElement (const QString &namespaceUri, const QString &key, const QString &value)
 
void writeOptionalAttribute (const QString &key, const QString &value, const QString &defaultValue=QString())
 
void writeOptionalElement (const QString &key, const QString &value, const QString &defaultValue=QString())
 
template<class T >
void writeOptionalElement (const QString &key, const T &value, const T &defaultValue=T())
 
- Public Member Functions inherited from QXmlStreamWriter
 QXmlStreamWriter (QByteArray *array)
 
 QXmlStreamWriter (QIODevice *device)
 
 QXmlStreamWriter (QString *string)
 
bool autoFormatting () const const
 
int autoFormattingIndent () const const
 
QTextCodeccodec () const const
 
QIODevicedevice () const const
 
bool hasError () const const
 
void setAutoFormatting (bool enable)
 
void setAutoFormattingIndent (int spacesOrTabs)
 
void setCodec (const char *codecName)
 
void setCodec (QTextCodec *codec)
 
void setDevice (QIODevice *device)
 
void writeAttribute (const QString &namespaceUri, const QString &name, const QString &value)
 
void writeAttribute (const QString &qualifiedName, const QString &value)
 
void writeAttribute (const QXmlStreamAttribute &attribute)
 
void writeAttributes (const QXmlStreamAttributes &attributes)
 
void writeCDATA (const QString &text)
 
void writeCharacters (const QString &text)
 
void writeComment (const QString &text)
 
void writeCurrentToken (const QXmlStreamReader &reader)
 
void writeDefaultNamespace (const QString &namespaceUri)
 
void writeDTD (const QString &dtd)
 
void writeEmptyElement (const QString &namespaceUri, const QString &name)
 
void writeEmptyElement (const QString &qualifiedName)
 
void writeEndDocument ()
 
void writeEndElement ()
 
void writeEntityReference (const QString &name)
 
void writeNamespace (const QString &namespaceUri, const QString &prefix)
 
void writeProcessingInstruction (const QString &target, const QString &data)
 
void writeStartDocument ()
 
void writeStartDocument (const QString &version)
 
void writeStartDocument (const QString &version, bool standalone)
 
void writeStartElement (const QString &namespaceUri, const QString &name)
 
void writeStartElement (const QString &qualifiedName)
 
void writeTextElement (const QString &namespaceUri, const QString &name, const QString &text)
 
void writeTextElement (const QString &qualifiedName, const QString &text)
 

Additional Inherited Members

- Properties inherited from QXmlStreamWriter
 autoFormatting
 
 autoFormattingIndent
 

Detailed Description

Standard Marble way of writing XML This class is intended to be a standardised way of writing XML for marble.

It works with the GeoData classes and writes XML based on the type of output format that the writer is currently working with.

Definition at line 25 of file GeoWriter.h.

Member Function Documentation

◆ setDocumentType()

void Marble::GeoWriter::setDocumentType ( const QString documentType)

Set the current document type.

The current Document Type defines which set of handlers are to be used when writing the GeoDocument. This string should correspond with the string used to register the required Tag Writers in

See also
GeoTagWriter

Definition at line 73 of file GeoWriter.cpp.

◆ write()

bool Marble::GeoWriter::write ( QIODevice device,
const GeoNode feature 
)

The main API call to use the XML writer.

To use the XML writer you need to provide an IODevice to write the XML to and a QList of GeoDataFeatures which contains the data you wish to write. To define the type of XML document that is to be written you need to set the current Document Type for this GeoWriter. See

See also
setDocumentType()

Definition at line 24 of file GeoWriter.cpp.

◆ writeElement() [1/2]

void Marble::GeoWriter::writeElement ( const QString key,
const QString value 
)

Convenience method to write <key>value</key>

Definition at line 85 of file GeoWriter.cpp.

◆ writeElement() [2/2]

void Marble::GeoWriter::writeElement ( const QString namespaceUri,
const QString key,
const QString value 
)

Convenience method to write <key>value</key> with key prefixed format namespaceUri.

Definition at line 78 of file GeoWriter.cpp.

◆ writeOptionalAttribute()

void Marble::GeoWriter::writeOptionalAttribute ( const QString key,
const QString value,
const QString defaultValue = QString() 
)

writeOptionalAttribute Convenience method to write k=v attributes if value is not equal to defaultValue

Definition at line 99 of file GeoWriter.cpp.

◆ writeOptionalElement()

void Marble::GeoWriter::writeOptionalElement ( const QString key,
const QString value,
const QString defaultValue = QString() 
)

Convenience method to write <key>value</key> if value is not equal to defaultValue.

Otherwise, nothing is written.

Definition at line 92 of file GeoWriter.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:53:14 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.