MapViewer/lib/osmparser/include/util.hpp

35 lines
916 B
C++
Raw Normal View History

2021-04-14 19:04:08 +00:00
#pragma once
#include <string>
2021-04-18 15:34:00 +00:00
#include <vector>
#include <memory>
2021-04-14 19:04:08 +00:00
namespace tinyxml2
{
class XMLElement;
}
namespace osmp
{
2021-04-18 15:34:00 +00: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 19:04:08 +00:00
typedef struct sBounds
{
2021-04-17 01:15:07 +00:00
double minlat, minlon, maxlat, maxlon;
2021-04-14 19:04:08 +00:00
} Bounds;
2021-04-18 13:44:48 +00: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 19:04:08 +00:00
}