MCPcopy Create free account
hub / github.com/comaps/comaps / DeleteNode

Method DeleteNode

libs/storage/storage.cpp:1632–1648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1630}
1631
1632void Storage::DeleteNode(CountryId const & countryId)
1633{
1634 CHECK_THREAD_CHECKER(m_threadChecker, ());
1635
1636 CountryTree::Node const * const node = m_countries.FindFirst(countryId);
1637
1638 if (!node)
1639 return;
1640
1641 auto const deleteAction = [this](CountryTree::Node const & descendantNode)
1642 {
1643 bool const onDisk = m_localFiles.find(descendantNode.Value().Name()) != m_localFiles.end();
1644 if (descendantNode.ChildrenCount() == 0 && onDisk)
1645 DeleteCountry(descendantNode.Value().Name(), MapFileType::Map);
1646 };
1647 node->ForEachInSubtree(deleteAction);
1648}
1649
1650StatusAndError Storage::GetNodeStatus(CountryTree::Node const & node) const
1651{

Callers 6

OnItemClickMethod · 0.80
UNIT_CLASS_TESTFunction · 0.80
DeleteGroupFunction · 0.80
UNIT_TESTFunction · 0.80
UNIT_TESTFunction · 0.80

Calls 7

FindFirstMethod · 0.80
ChildrenCountMethod · 0.80
findMethod · 0.45
NameMethod · 0.45
ValueMethod · 0.45
endMethod · 0.45
ForEachInSubtreeMethod · 0.45

Tested by 4

UNIT_CLASS_TESTFunction · 0.64
DeleteGroupFunction · 0.64
UNIT_TESTFunction · 0.64
UNIT_TESTFunction · 0.64