diff --git a/editor/xml_feature.cpp b/editor/xml_feature.cpp index 3705e82a7b..d4161edf21 100644 --- a/editor/xml_feature.cpp +++ b/editor/xml_feature.cpp @@ -102,6 +102,11 @@ XMLFeature::XMLFeature(pugi::xml_node const & xml) r.name() == kNodeType ? ValidateNode(r) : ValidateWay(r); } +bool XMLFeature::operator==(XMLFeature const & other) const +{ + return ToOSMString() == other.ToOSMString(); +} + XMLFeature::Type XMLFeature::GetType() const { return strcmp(GetRootNode().name(), "node") == 0 ? Type::Node : Type::Way; diff --git a/editor/xml_feature.hpp b/editor/xml_feature.hpp index 3c9230bc40..3821be7b5e 100644 --- a/editor/xml_feature.hpp +++ b/editor/xml_feature.hpp @@ -39,6 +39,8 @@ public: XMLFeature(pugi::xml_document const & xml); XMLFeature(pugi::xml_node const & xml); XMLFeature(XMLFeature const & feature) : XMLFeature(feature.m_document) {} + bool operator==(XMLFeature const & other) const; + void Save(ostream & ost) const; string ToOSMString() const;