diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index 43def68770..c7a7478756 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -563,6 +563,21 @@ bool Editor::GetEditedFeatureStreet(FeatureType const & feature, string & outFea return true; } +vector Editor::GetFeaturesByStatus(MwmSet::MwmId const & mwmId, FeatureStatus status) const +{ + vector features; + auto const matchedMwm = m_features.find(mwmId); + if (matchedMwm == m_features.end()) + return features; + for (auto const & index : matchedMwm->second) + { + if (index.second.m_status == status) + features.push_back(index.first); + } + sort(features.begin(), features.end()); + return features; +} + vector Editor::EditableMetadataForType(FeatureType const & feature) const { // TODO(mgsergio): Load editable fields into memory from XML and query them here. diff --git a/indexer/osm_editor.hpp b/indexer/osm_editor.hpp index 667bc3dc3e..053fd5080b 100644 --- a/indexer/osm_editor.hpp +++ b/indexer/osm_editor.hpp @@ -82,6 +82,9 @@ public: /// @param outFeatureStreet is valid only if true was returned. bool GetEditedFeatureStreet(FeatureType const & feature, string & outFeatureStreet) const; + /// @returns sorted features indices with specified status. + vector GetFeaturesByStatus(MwmSet::MwmId const & mwmId, FeatureStatus status) const; + /// Editor checks internally if any feature params were actually edited. /// House number is correctly updated for editedFeature (if it's valid). void EditFeature(FeatureType & editedFeature,