| 138 | } |
| 139 | |
| 140 | bool MapcssRule::Matches(std::vector<OsmElement::Tag> const & tags) const |
| 141 | { |
| 142 | for (auto const & tag : m_tags) |
| 143 | if (!base::AnyOf(tags, [&](auto const & t) { return t == tag; })) |
| 144 | return false; |
| 145 | |
| 146 | /// @todo Should we also take into account "none", "false" here? |
| 147 | |
| 148 | for (auto const & key : m_mandatoryKeys) |
| 149 | if (!base::AnyOf(tags, [&](auto const & t) { return t.m_key == key && t.m_value != "no"; })) |
| 150 | return false; |
| 151 | |
| 152 | for (auto const & key : m_forbiddenKeys) |
| 153 | if (!base::AllOf(tags, [&](auto const & t) { return t.m_key != key || t.m_value == "no"; })) |
| 154 | return false; |
| 155 | |
| 156 | return true; |
| 157 | } |
| 158 | |
| 159 | // The data/mapcss-mapping.csv format is described inside the file itself. |
| 160 | MapcssRules ParseMapCSS(std::unique_ptr<Reader> reader) |
no test coverage detected