Public Member Functions | Data Fields
osmxml::XmlParser Class Reference

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.

Detailed Description

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.


Constructor & Destructor Documentation

osmxml::XmlParser::XmlParser ( )

Definition at line 34 of file XmlParser.cpp.

osmxml::XmlParser::~XmlParser ( ) [virtual]

Definition at line 67 of file XmlParser.cpp.


Member Function Documentation

void osmxml::XmlParser::parse_file ( std::string const &  filename)

Process xml file.

Parameters:
filenamename of the file

Definition at line 71 of file XmlParser.cpp.

void osmxml::XmlParser::parse_memory ( std::string const &  mem)

Process xml in std::string.

Parameters:
memstd::string containing xml to be processed

Definition at line 78 of file XmlParser.cpp.

void osmxml::XmlParser::parse_stream ( std::istream &  stream)

Process xml from stream.

Parameters:
stream

Definition at line 84 of file XmlParser.cpp.


Field Documentation

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.


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines