OSM::AbstractReader
#include <abstractreader.h>
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 | |
DataSet * | m_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()
|
explicitprotected |
Definition at line 72 of file abstractreader.cpp.
Member Function Documentation
◆ addNode()
|
protected |
Add read elements to the merge buffer if set, or the dataset otherwise.
Definition at line 126 of file abstractreader.cpp.
◆ addRelation()
|
protected |
Definition at line 136 of file abstractreader.cpp.
◆ addWay()
|
protected |
Definition at line 131 of file abstractreader.cpp.
◆ errorString()
|
nodiscard |
Error message in case parsing failed for some reason.
Definition at line 121 of file abstractreader.cpp.
◆ hasError()
|
nodiscard |
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()
|
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()
|
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
|
protected |
Definition at line 69 of file abstractreader.h.
◆ m_error
|
protected |
Definition at line 70 of file abstractreader.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:55:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.