OSM::AbstractReader

Search for usage in LXR

#include <abstractreader.h>

Inheritance diagram for OSM::AbstractReader:

Public Member Functions

QString errorString () const
 
bool hasError () const
 
void read (const uint8_t *data, std::size_t len)
 
void read (QIODevice *io)
 
void setMergeBuffer (OSM::DataSetMergeBuffer *buffer)
 

Protected Member Functions

 AbstractReader (DataSet *dataSet)
 
void addNode (OSM::Node &&node)
 
void addRelation (OSM::Relation &&relation)
 
void addWay (OSM::Way &&way)
 
virtual void readFromData (const uint8_t *data, std::size_t len)
 
virtual void readFromIODevice (QIODevice *io)
 

Protected Attributes

DataSetm_dataSet = nullptr
 
QString m_error
 

Detailed Description

Abstract base class for OSM file format readers.

Definition at line 27 of file abstractreader.h.

Constructor & Destructor Documentation

◆ AbstractReader()

AbstractReader::AbstractReader ( OSM::DataSet * dataSet)
explicitprotected

Definition at line 72 of file abstractreader.cpp.

Member Function Documentation

◆ addNode()

void AbstractReader::addNode ( OSM::Node && node)
protected

Add read elements to the merge buffer if set, or the dataset otherwise.

Definition at line 126 of file abstractreader.cpp.

◆ addRelation()

void AbstractReader::addRelation ( OSM::Relation && relation)
protected

Definition at line 136 of file abstractreader.cpp.

◆ addWay()

void AbstractReader::addWay ( OSM::Way && way)
protected

Definition at line 131 of file abstractreader.cpp.

◆ errorString()

QString AbstractReader::errorString ( ) const

Error message in case parsing failed for some reason.

Definition at line 121 of file abstractreader.cpp.

◆ hasError()

bool AbstractReader::hasError ( ) const

Definition at line 116 of file abstractreader.cpp.

◆ read() [1/2]

void AbstractReader::read ( const uint8_t * data,
std::size_t len )

Read the given data.

Useful e.g. for working on memory-mapped data.

Definition at line 85 of file abstractreader.cpp.

◆ read() [2/2]

void AbstractReader::read ( QIODevice * io)

Read data from the given QIODevice.

Definition at line 93 of file abstractreader.cpp.

◆ readFromData()

void AbstractReader::readFromData ( const uint8_t * data,
std::size_t len )
protectedvirtual

Implement for actual parsing.

The default implementation convert into the respective other form, so implementing one is enough.

Definition at line 101 of file abstractreader.cpp.

◆ readFromIODevice()

void AbstractReader::readFromIODevice ( QIODevice * io)
protectedvirtual

Definition at line 109 of file abstractreader.cpp.

◆ setMergeBuffer()

void AbstractReader::setMergeBuffer ( OSM::DataSetMergeBuffer * buffer)

Sets a merge buffer.

When set, the parser will insert all elements into that buffer rather than in the OSM::DataSet specified in the constructor. It is then your responsibility to properly integrate those.

Note
The OSM::DataSet is used for generating tag keys and for memory managing strings in this case as well. So the generated elements are tied to the OSM::DataSet in any case.

Definition at line 80 of file abstractreader.cpp.

Member Data Documentation

◆ m_dataSet

DataSet* OSM::AbstractReader::m_dataSet = nullptr
protected

Definition at line 69 of file abstractreader.h.

◆ m_error

QString OSM::AbstractReader::m_error
protected

Definition at line 70 of file abstractreader.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 Fri Jun 14 2024 11:56:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.