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

Method Matches

generator/utils.cpp:140–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140bool 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.
160MapcssRules ParseMapCSS(std::unique_ptr<Reader> reader)

Callers 1

MatchTypesFunction · 0.45

Calls 2

AnyOfFunction · 0.85
AllOfFunction · 0.85

Tested by

no test coverage detected