diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index dc7af00c07..58b176f2b5 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -726,4 +726,22 @@ void Editor::Invalidate() if (m_invalidateFn) m_invalidateFn(); } + +Editor::Stats Editor::GetStats() const +{ + Stats stats; + for (auto const & id : m_features) + { + for (auto const & index : id.second) + { + Editor::FeatureTypeInfo const & fti = index.second; + stats.m_edits.push_back(make_pair(FeatureID(id.first, index.first), + fti.m_uploadStatus + " " + fti.m_uploadError)); + if (fti.m_uploadStatus == kUploaded) + ++stats.m_uploadedCount; + } + } + return stats; +} + } // namespace osm diff --git a/indexer/osm_editor.hpp b/indexer/osm_editor.hpp index 87d247d63c..ecd4b79b83 100644 --- a/indexer/osm_editor.hpp +++ b/indexer/osm_editor.hpp @@ -101,6 +101,14 @@ public: void UploadChanges(string const & key, string const & secret, TChangesetTags tags, TFinishUploadCallback callBack = TFinishUploadCallback()); + struct Stats + { + /// + vector> m_edits; + size_t m_uploadedCount = 0; + }; + Stats GetStats() const; + private: // TODO(AlexZ): Synchronize Save call/make it on a separate thread. void Save(string const & fullFilePath) const;