[editor] ChangesetWrapper::Delete implementation.

This commit is contained in:
Alex Zolotarev 2016-03-10 14:07:38 +03:00 committed by Sergey Yershov
parent 93c26d54bd
commit e950d0cca6
2 changed files with 13 additions and 0 deletions

View file

@ -123,4 +123,14 @@ void ChangesetWrapper::Modify(XMLFeature node)
m_api.ModifyElement(node);
}
void ChangesetWrapper::Delete(XMLFeature node)
{
if (m_changesetId == kInvalidChangesetId)
m_changesetId = m_api.CreateChangeSet(m_changesetComments);
// Changeset id should be updated for every OSM server commit.
node.SetAttribute("changeset", strings::to_string(m_changesetId));
m_api.DeleteElement(node);
}
} // namespace osm

View file

@ -44,6 +44,9 @@ public:
/// Node should have correct OSM "id" attribute set.
void Modify(editor::XMLFeature node);
/// Throws exceptions from above list.
void Delete(editor::XMLFeature node);
private:
/// Unfortunately, pugi can't return xml_documents from methods.
/// Throws exceptions from above list.