MapViewer/lib/osmparser/include/util.hpp

35 lines
916 B
C++
Raw Normal View History

2021-04-14 21:04:08 +02:00
#pragma once
#include <string>
2021-04-18 17:34:00 +02:00
#include <vector>
#include <memory>
2021-04-14 21:04:08 +02:00
namespace tinyxml2
{
class XMLElement;
}
namespace osmp
{
2021-04-18 17:34:00 +02:00
class INode;
class IWay;
class IRelation;
typedef std::shared_ptr<INode> Node;
typedef std::shared_ptr<IWay> Way;
typedef std::shared_ptr<IRelation> Relation;
typedef std::vector<Node> Nodes;
typedef std::vector<Way> Ways;
typedef std::vector<Relation> Relations;
2021-04-14 21:04:08 +02:00
typedef struct sBounds
{
2021-04-17 03:15:07 +02:00
double minlat, minlon, maxlat, maxlon;
2021-04-14 21:04:08 +02:00
} Bounds;
2021-04-18 15:44:48 +02:00
[[nodiscard]] std::string GetSafeAttributeString(const tinyxml2::XMLElement* elem, const std::string& name);
[[nodiscard]] double GetSafeAttributeFloat(const tinyxml2::XMLElement* elem, const std::string& name);
[[nodiscard]] uint64_t GetSafeAttributeUint64(const tinyxml2::XMLElement* elem, const std::string& name);
[[nodiscard]] bool GetSafeAttributeBool(const tinyxml2::XMLElement* elem, const std::string& name);
2021-04-14 21:04:08 +02:00
}