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
 
QIODevicedevice () const const
 
bool hasError () const const
 
void setAutoFormatting (bool enable)
 
void setAutoFormattingIndent (int spacesOrTabs)
 
void setDevice (QIODevice *device)
 
void writeAttribute (const QXmlStreamAttribute &attribute)
 
void writeAttribute (QAnyStringView namespaceUri, QAnyStringView name, QAnyStringView value)
 
void writeAttribute (QAnyStringView qualifiedName, QAnyStringView value)
 
void writeAttributes (const QXmlStreamAttributes &attributes)
 
void writeCDATA (QAnyStringView text)
 
void writeCharacters (QAnyStringView text)
 
void writeComment (QAnyStringView text)
 
void writeCurrentToken (const QXmlStreamReader &reader)
 
void writeDefaultNamespace (QAnyStringView namespaceUri)
 
void writeDTD (QAnyStringView dtd)
 
void writeEmptyElement (QAnyStringView namespaceUri, QAnyStringView name)
 
void writeEmptyElement (QAnyStringView qualifiedName)
 
void writeEndDocument ()
 
void writeEndElement ()
 
void writeEntityReference (QAnyStringView name)
 
void writeNamespace (QAnyStringView namespaceUri, QAnyStringView prefix)
 
void writeProcessingInstruction (QAnyStringView target, QAnyStringView data)
 
void writeStartDocument ()
 
void writeStartDocument (QAnyStringView version)
 
void writeStartDocument (QAnyStringView version, bool standalone)
 
void writeStartElement (QAnyStringView namespaceUri, QAnyStringView name)
 
void writeStartElement (QAnyStringView qualifiedName)
 
void writeTextElement (QAnyStringView namespaceUri, QAnyStringView name, QAnyStringView text)
 
void writeTextElement (QAnyStringView qualifiedName, QAnyStringView 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.

Constructor & Destructor Documentation

◆ GeoWriter()

Marble::GeoWriter::GeoWriter ( )

Definition at line 17 of file GeoWriter.cpp.

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 70 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 23 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 82 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 75 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 96 of file GeoWriter.cpp.

◆ writeOptionalElement() [1/2]

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 89 of file GeoWriter.cpp.

◆ writeOptionalElement() [2/2]

template<class T >
void Marble::GeoWriter::writeOptionalElement ( const QString & key,
const T & value,
const T & defaultValue = T() )
inline

Definition at line 73 of file GeoWriter.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.