1#ifndef OSMIUM_TAGS_FILTER_HPP
2#define OSMIUM_TAGS_FILTER_HPP
49 template <
typename TKey>
51 bool operator()(
const TKey& rule_key,
const char* tag_key)
const {
52 return rule_key == tag_key;
58 bool operator()(
const std::string& rule_key,
const char* tag_key)
const {
59 return !std::strcmp(rule_key.c_str(), tag_key);
64 bool operator()(
const std::string& rule_key,
const char* tag_key)
const {
65 return rule_key.compare(0, std::string::npos, tag_key, 0, rule_key.size()) == 0;
69 template <
typename TValue>
71 bool operator()(
const TValue& rule_value,
const char* tag_value)
const {
72 return rule_value == tag_value;
78 bool operator()(
const std::string& rule_value,
const char* tag_value)
const {
79 return !std::strcmp(rule_value.c_str(), tag_value);
85 bool operator()(
const bool ,
const char* )
const noexcept {
91 template <
typename TKey,
typename TValue =
void,
typename TKeyComp = match_key<TKey>,
typename TValueComp = match_value<TValue>>
95 using value_type =
typename std::conditional<std::is_void<TValue>::value, bool, TValue>
::type;
129 explicit Filter(
bool default_result =
false) :
133 template <typename V = TValue, typename std::enable_if<!std::is_void<V>::value,
int>
::type = 0>
135 m_rules.emplace_back(result,
false, key, value);
140 m_rules.emplace_back(result,
true, key);
146 if (TKeyComp()(rule.key, tag.
key()) && (rule.ignore_value || TValueComp()(rule.value, tag.
value()))) {
const char * key() const noexcept
Definition: tag.hpp:86
const char * value() const noexcept
Definition: tag.hpp:95
Definition: collection.hpp:117
type
Definition: entity_bits.hpp:63
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Definition: location.hpp:555