コード例 #1
0
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));
}
コード例 #2
0
                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());
                    }
                }