void write_tags(const osmium::TagList& tags) { *m_out += " T"; if (tags.empty()) { return; } auto it = tags.begin(); append_encoded_string(it->key()); *m_out += '='; append_encoded_string(it->value()); for (++it; it != tags.end(); ++it) { *m_out += ','; append_encoded_string(it->key()); *m_out += '='; append_encoded_string(it->value()); } }
void check_filter(const osmium::TagList& tag_list, const TFilter filter, const std::vector<bool>& reference) { REQUIRE(tag_list.size() == reference.size()); auto t_it = tag_list.begin(); for (auto it = reference.begin(); it != reference.end(); ++t_it, ++it) { REQUIRE(filter(*t_it) == *it); } typename TFilter::iterator fi_begin(filter, tag_list.begin(), tag_list.end()); typename TFilter::iterator fi_end(filter, tag_list.end(), tag_list.end()); REQUIRE(std::distance(fi_begin, fi_end) == std::count(reference.begin(), reference.end(), true)); }
inline bool match_none_of(const osmium::TagList& tag_list, const TFilter& filter) { return std::none_of(tag_list.cbegin(), tag_list.cend(), std::cref(filter)); }
inline bool match_none_of(const osmium::TagList& tag_list, TFilter&& filter) { return std::none_of(tag_list.cbegin(), tag_list.cend(), std::forward<TFilter>(filter)); }