Responsible for reading osm xml exports and converting them to osm::Element. More...
#include <XmlParser.h>
Public Member Functions | |
XmlParser () | |
virtual | ~XmlParser () |
void | parse_file (std::string const &filename) |
Process xml file. | |
void | parse_memory (std::string const &mem) |
Process xml in std::string. | |
void | parse_stream (std::istream &stream) |
Process xml from stream. | |
Data Fields | |
std::function< void(osm::Node const &)> | node_handler |
Node callback. | |
std::function< void(osm::Way const &)> | way_handler |
Way callback. | |
std::function< void(osm::Relation const &)> | relation_handler |
Relation callback. | |
std::function< void()> | progress_handler |
This gets called after every element - to notify that progress is being made. |
Responsible for reading osm xml exports and converting them to osm::Element.
Reads input and calls registered callbacks as elements are encoutered.
Definition at line 24 of file XmlParser.h.
osmxml::XmlParser::XmlParser | ( | ) |
Definition at line 34 of file XmlParser.cpp.
osmxml::XmlParser::~XmlParser | ( | ) | [virtual] |
Definition at line 67 of file XmlParser.cpp.
void osmxml::XmlParser::parse_file | ( | std::string const & | filename | ) |
void osmxml::XmlParser::parse_memory | ( | std::string const & | mem | ) |
Process xml in std::string.
mem | std::string containing xml to be processed |
Definition at line 78 of file XmlParser.cpp.
void osmxml::XmlParser::parse_stream | ( | std::istream & | stream | ) |
std::function<void (osm::Node const&)> osmxml::XmlParser::node_handler |
Node callback.
Definition at line 32 of file XmlParser.h.
std::function<void ()> osmxml::XmlParser::progress_handler |
This gets called after every element - to notify that progress is being made.
Definition at line 44 of file XmlParser.h.
std::function<void (osm::Relation const&)> osmxml::XmlParser::relation_handler |
Relation callback.
Definition at line 40 of file XmlParser.h.
std::function<void (osm::Way const&)> osmxml::XmlParser::way_handler |
Way callback.
Definition at line 36 of file XmlParser.h.